com.thoughtworks.xstream.XStream.addImmutableType()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(207)

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

XStream.addImmutableType介绍

[英]Add immutable types. The value of the instances of these types will always be written into the stream even if they appear multiple times. However, references are still supported at deserialization time.
[中]添加不可变类型。这些类型的实例的值将始终写入流中,即使它们出现多次。但是,在反序列化时仍然支持引用。

代码示例

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

/**
 * Add immutable types. The value of the instances of these types will always be written into the stream even if
 * they appear multiple times. However, references are still supported at deserialization time.
 *
 * @throws InitializationException if no {@link ImmutableTypesMapper} is available
 * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)}
 */
public void addImmutableType(Class type) {
  addImmutableType(type, true);
}

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

addImmutableType(boolean.class, false);
addImmutableType(Boolean.class, false);
addImmutableType(byte.class, false);
addImmutableType(Byte.class, false);
addImmutableType(char.class, false);
addImmutableType(Character.class, false);
addImmutableType(double.class, false);
addImmutableType(Double.class, false);
addImmutableType(float.class, false);
addImmutableType(Float.class, false);
addImmutableType(int.class, false);
addImmutableType(Integer.class, false);
addImmutableType(long.class, false);
addImmutableType(Long.class, false);
addImmutableType(short.class, false);
addImmutableType(Short.class, false);
addImmutableType(Mapper.Null.class, false);
addImmutableType(BigDecimal.class, false);
addImmutableType(BigInteger.class, false);
addImmutableType(String.class, false);
addImmutableType(URL.class, false);
addImmutableType(File.class, false);
addImmutableType(Class.class, false);
        Object path = methodGet.invoke(null, new Object[]{".", new String[0]});
        if (path != null) {
          addImmutableType(path.getClass(), false);

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

private void addImmutableTypeDynamically(String className, boolean isReferenceable) {
  Class type = JVM.loadClassForName(className);
  if (type != null) {
    addImmutableType(type, isReferenceable);
  }
}

代码示例来源:origin: AxonFramework/AxonFramework

/**
 * Instantiate a {@link AbstractXStreamSerializer} based on the fields contained in the {@link Builder}.
 *
 * @param builder the {@link Builder} used to instantiate a {@link AbstractXStreamSerializer} instance
 */
protected AbstractXStreamSerializer(Builder builder) {
  builder.validate();
  this.charset = builder.charset;
  this.xStream = builder.xStream;
  this.converter = builder.converter;
  this.revisionResolver = builder.revisionResolver;
  if (converter instanceof ChainingConverter) {
    registerConverters((ChainingConverter) converter);
  }
  xStream.addImmutableType(UUID.class, true);
  // Message serialization
  xStream.alias("domain-event", GenericDomainEventMessage.class);
  xStream.alias("event", GenericEventMessage.class);
  xStream.alias("command", GenericCommandMessage.class);
  // For backward compatibility
  xStream.alias("uuid", UUID.class);
  xStream.alias("meta-data", MetaData.class);
  xStream.registerConverter(new MetaDataConverter(xStream.getMapper()));
}

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

/**
 * Add immutable types. The value of the instances of these types will always be written into the stream even if
 * they appear multiple times. However, references are still supported at deserialization time.
 *
 * @throws InitializationException if no {@link ImmutableTypesMapper} is available
 * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)}
 */
public void addImmutableType(Class type) {
  addImmutableType(type, true);
}

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

/**
 * Add immutable types. The value of the instances of these types will always be written into the stream even if
 * they appear multiple times. However, references are still supported at deserialization time.
 *
 * @throws InitializationException if no {@link ImmutableTypesMapper} is available
 * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)}
 */
public void addImmutableType(Class type) {
  addImmutableType(type, true);
}

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

/**
 * Add immutable types. The value of the instances of these types will always be written into the stream even if
 * they appear multiple times. However, references are still supported at deserialization time.
 *
 * @throws InitializationException if no {@link ImmutableTypesMapper} is available
 * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)}
 */
public void addImmutableType(Class type) {
  addImmutableType(type, true);
}

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

/**
 * Add immutable types. The value of the instances of these types will always be written into the stream even if
 * they appear multiple times. However, references are still supported at deserialization time.
 *
 * @throws InitializationException if no {@link ImmutableTypesMapper} is available
 * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)}
 */
@Deprecated
public void addImmutableType(final Class<?> type) {
  addImmutableType(type, true);
}

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

addImmutableType(boolean.class);
addImmutableType(Boolean.class);
addImmutableType(byte.class);
addImmutableType(Byte.class);
addImmutableType(char.class);
addImmutableType(Character.class);
addImmutableType(double.class);
addImmutableType(Double.class);
addImmutableType(float.class);
addImmutableType(Float.class);
addImmutableType(int.class);
addImmutableType(Integer.class);
addImmutableType(long.class);
addImmutableType(Long.class);
addImmutableType(short.class);
addImmutableType(Short.class);
addImmutableType(Mapper.Null.class);
addImmutableType(BigDecimal.class);
addImmutableType(BigInteger.class);
addImmutableType(String.class);
addImmutableType(URL.class);
addImmutableType(File.class);
addImmutableType(Class.class);
  addImmutableType(jvm.loadClass("java.awt.font.TextAttribute"));
  addImmutableType(type);

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

addImmutableType(boolean.class);
addImmutableType(Boolean.class);
addImmutableType(byte.class);
addImmutableType(Byte.class);
addImmutableType(char.class);
addImmutableType(Character.class);
addImmutableType(double.class);
addImmutableType(Double.class);
addImmutableType(float.class);
addImmutableType(Float.class);
addImmutableType(int.class);
addImmutableType(Integer.class);
addImmutableType(long.class);
addImmutableType(Long.class);
addImmutableType(short.class);
addImmutableType(Short.class);
addImmutableType(Mapper.Null.class);
addImmutableType(BigDecimal.class);
addImmutableType(BigInteger.class);
addImmutableType(String.class);
addImmutableType(URL.class);
addImmutableType(File.class);
addImmutableType(Class.class);
  addImmutableType(jvm.loadClass("java.awt.font.TextAttribute"));
  addImmutableType(type);

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

private void addImmutableTypeDynamically(String className, boolean isReferenceable) {
  Class type = JVM.loadClassForName(className);
  if (type != null) {
    addImmutableType(type, isReferenceable);
  }
}

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

private void addImmutableTypeDynamically(final String className, final boolean isReferenceable) {
  final Class<?> type = JVM.loadClassForName(className);
  if (type != null) {
    addImmutableType(type, isReferenceable);
  }
}

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

private void addImmutableTypeDynamically(String className) {
  Class type = jvm.loadClass(className);
  if (type != null) {
    addImmutableType(type);
  }
}

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

private void addImmutableTypeDynamically(String className, boolean isReferenceable) {
  Class type = JVM.loadClassForName(className);
  if (type != null) {
    addImmutableType(type, isReferenceable);
  }
}

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

private void addImmutableTypeDynamically(String className) {
  Class type = JVM.loadClassForName(className);
  if (type != null) {
    addImmutableType(type);
  }
}

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

private void addImmutableTypeDynamically(String className, boolean isReferenceable) {
  Class type = JVM.loadClassForName(className);
  if (type != null) {
    addImmutableType(type, isReferenceable);
  }
}

代码示例来源:origin: org.axonframework/axon-messaging

/**
 * Instantiate a {@link AbstractXStreamSerializer} based on the fields contained in the {@link Builder}.
 *
 * @param builder the {@link Builder} used to instantiate a {@link AbstractXStreamSerializer} instance
 */
protected AbstractXStreamSerializer(Builder builder) {
  builder.validate();
  this.charset = builder.charset;
  this.xStream = builder.xStream;
  this.converter = builder.converter;
  this.revisionResolver = builder.revisionResolver;
  if (converter instanceof ChainingConverter) {
    registerConverters((ChainingConverter) converter);
  }
  xStream.addImmutableType(UUID.class, true);
  // Message serialization
  xStream.alias("domain-event", GenericDomainEventMessage.class);
  xStream.alias("event", GenericEventMessage.class);
  xStream.alias("command", GenericCommandMessage.class);
  // For backward compatibility
  xStream.alias("uuid", UUID.class);
  xStream.alias("meta-data", MetaData.class);
  xStream.registerConverter(new MetaDataConverter(xStream.getMapper()));
}

代码示例来源:origin: violetumleditor/violetumleditor

xStream.useAttributeFor(Point2D.Double.class, "y");
xStream.alias("Point2D.Double", Point2D.Double.class);
xStream.addImmutableType(ArrowheadChoiceList.class);
xStream.addImmutableType(LineStyleChoiceList.class);
xStream.addImmutableType(BentStyleChoiceList.class);
List<IDiagramPlugin> diagramPlugins = this.pluginRegistry.getDiagramPlugins();
for (IDiagramPlugin aPlugin : diagramPlugins) {

代码示例来源:origin: org.axonframework/axon-core

registerConverters((ChainingConverter) converter);
xStream.addImmutableType(UUID.class, true);

代码示例来源:origin: org.everit.osgi.bundles/org.everit.osgi.bundles.com.esendex.javasdk

xStream.addImmutableType(MessageRequestDto.class);

相关文章