com.thoughtworks.xstream.mapper.Mapper.isImmutableValueType()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(248)

本文整理了Java中com.thoughtworks.xstream.mapper.Mapper.isImmutableValueType()方法的一些代码示例,展示了Mapper.isImmutableValueType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mapper.isImmutableValueType()方法的具体详情如下:
包路径:com.thoughtworks.xstream.mapper.Mapper
类名称:Mapper
方法名:isImmutableValueType

Mapper.isImmutableValueType介绍

[英]Whether this type is a simple immutable value (int, boolean, String, URL, etc). Immutable types will be repeatedly written in the serialized stream, instead of using object references.
[中]该类型是否为简单的不可变值(int、boolean、String、URL等)。不可变类型将重复写入序列化流中,而不是使用对象引用。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. public boolean isImmutableValueType(Class type) {
  2. return delegate.isImmutableValueType(type);
  3. }

代码示例来源:origin: com.thoughtworks.xstream/xstream

  1. public boolean isImmutableValueType(Class type) {
  2. return isImmutableValueTypeMapper.isImmutableValueType(type);
  3. }

代码示例来源:origin: com.thoughtworks.xstream/xstream

  1. public void convert(Object item, Converter converter) {
  2. if (getMapper().isImmutableValueType(item.getClass())) {

代码示例来源:origin: com.haulmont.thirdparty/xstream

  1. public boolean isImmutableValueType(Class type) {
  2. return wrapped.isImmutableValueType(type);
  3. }

代码示例来源:origin: x-stream/xstream

  1. @Override
  2. public boolean isImmutableValueType(final Class<?> type) {
  3. return isImmutableValueTypeMapper.isImmutableValueType(type);
  4. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. public boolean isImmutableValueType(Class type) {
  2. return delegate.isImmutableValueType(type);
  3. }

代码示例来源:origin: org.jvnet.hudson/xstream

  1. public boolean isImmutableValueType(Class type) {
  2. return wrapped.isImmutableValueType(type);
  3. }

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

  1. public boolean isImmutableValueType(Class type) {
  2. return wrapped.isImmutableValueType(type);
  3. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

  1. public boolean isImmutableValueType(Class type) {
  2. return isImmutableValueTypeMapper.isImmutableValueType(type);
  3. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

  1. public boolean isImmutableValueType(Class type) {
  2. return isImmutableValueTypeMapper.isImmutableValueType(type);
  3. }

代码示例来源:origin: ovea-deprecated/jetty-session-redis

  1. public boolean isImmutableValueType(Class type) {
  2. return wrapped.isImmutableValueType(type);
  3. }

代码示例来源:origin: apache/servicemix-bundles

  1. public boolean isImmutableValueType(Class type) {
  2. return isImmutableValueTypeMapper.isImmutableValueType(type);
  3. }

代码示例来源:origin: micromata/projectforge

  1. @Override
  2. public void convertAnother(Object item)
  3. {
  4. Class<?> targetClass = item.getClass();
  5. while (Enhancer.isEnhanced(targetClass) == true) {
  6. targetClass = targetClass.getSuperclass();
  7. }
  8. Converter converter = converterLookup.lookupConverterForType(targetClass);
  9. Object realItem = HibernateProxyHelper.get(item);
  10. if (classMapper.isImmutableValueType(realItem.getClass())) {
  11. // strings, ints, dates, etc... don't bother using references.
  12. converter.marshal(item, writer, this);
  13. } else {
  14. Object idOfExistingReference = references.lookupId(realItem);
  15. if (idOfExistingReference != null) {
  16. writer.addAttribute("reference", idOfExistingReference.toString());
  17. return;
  18. }
  19. String newId = idGenerator.next(realItem);
  20. writer.addAttribute("id", newId);
  21. references.associateId(realItem, newId);
  22. if (log.isDebugEnabled()) {
  23. log.debug("marshalling object " + realItem.getClass() + " to stream");
  24. }
  25. converter.marshal(realItem, writer, this);
  26. }
  27. }

代码示例来源:origin: org.jvnet.hudson/xstream

  1. public void convert(Object item, Converter converter) {
  2. if (getMapper().isImmutableValueType(item.getClass())) {
  3. // strings, ints, dates, etc... don't bother using references.
  4. converter.marshal(item, writer, this);
  5. } else {
  6. Path currentPath = pathTracker.getPath();
  7. Object existingReferenceKey = references.lookupId(item);
  8. if (existingReferenceKey != null) {
  9. String attributeName = getMapper().aliasForSystemAttribute("reference");
  10. if (attributeName != null) {
  11. writer.addAttribute(attributeName, createReference(currentPath, existingReferenceKey));
  12. }
  13. } else if (implicitElements.lookupId(item) != null) {
  14. throw new ReferencedImplicitElementException(item, currentPath);
  15. } else {
  16. Object newReferenceKey = createReferenceKey(currentPath, item);
  17. if (lastPath == null || !currentPath.isAncestor(lastPath)) {
  18. fireValidReference(newReferenceKey);
  19. lastPath = currentPath;
  20. references.associateId(item, newReferenceKey);
  21. } else {
  22. implicitElements.associateId(item, newReferenceKey);
  23. }
  24. converter.marshal(item, writer, this);
  25. }
  26. }
  27. }

代码示例来源:origin: ovea-deprecated/jetty-session-redis

  1. public void convert(Object item, Converter converter) {
  2. if (getMapper().isImmutableValueType(item.getClass())) {
  3. // strings, ints, dates, etc... don't bother using references.
  4. converter.marshal(item, writer, this);
  5. } else {
  6. Path currentPath = pathTracker.getPath();
  7. Object existingReferenceKey = references.lookupId(item);
  8. if (existingReferenceKey != null) {
  9. String attributeName = getMapper().aliasForSystemAttribute("reference");
  10. if (attributeName != null) {
  11. writer.addAttribute(attributeName, createReference(currentPath, existingReferenceKey));
  12. }
  13. } else if (implicitElements.lookupId(item) != null) {
  14. throw new ReferencedImplicitElementException(item, currentPath);
  15. } else {
  16. Object newReferenceKey = createReferenceKey(currentPath, item);
  17. if (lastPath == null || !currentPath.isAncestor(lastPath)) {
  18. fireValidReference(newReferenceKey);
  19. lastPath = currentPath;
  20. references.associateId(item, newReferenceKey);
  21. } else {
  22. implicitElements.associateId(item, newReferenceKey);
  23. }
  24. converter.marshal(item, writer, this);
  25. }
  26. }
  27. }

代码示例来源:origin: com.haulmont.thirdparty/xstream

  1. public void convert(Object item, Converter converter) {
  2. if (getMapper().isImmutableValueType(item.getClass())) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

  1. public void convert(Object item, Converter converter) {
  2. if (getMapper().isImmutableValueType(item.getClass())) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

  1. public void convert(Object item, Converter converter) {
  2. if (getMapper().isImmutableValueType(item.getClass())) {

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

  1. public void convert(Object item, Converter converter) {
  2. if (getMapper().isImmutableValueType(item.getClass())) {

代码示例来源:origin: x-stream/xstream

  1. @Override
  2. public void convert(final Object item, final Converter converter) {
  3. if (getMapper().isImmutableValueType(item.getClass())) {

相关文章