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

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

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

XStream.addDefaultImplementation介绍

[英]Associate a default implementation of a class with an object. Whenever XStream encounters an instance of this type, it will use the default implementation instead. For example, java.util.ArrayList is the default implementation of java.util.List.
[中]将类的默认实现与对象关联。每当XStream遇到这种类型的实例时,它都会使用默认实现。例如,java。util。ArrayList是java的默认实现。util。列表

代码示例

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(TreeSet.class, SortedSet.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

/**
 * Alias a Class to a shorter name to be used in XML elements.
 *
 * @param name Short name
 * @param type Type to be aliased
 * @param defaultImplementation Default implementation of type to use if no other specified.
 * @throws InitializationException if no {@link DefaultImplementationsMapper} or no
 *             {@link ClassAliasingMapper} is available
 */
public void alias(String name, Class type, Class defaultImplementation) {
  alias(name, type);
  addDefaultImplementation(defaultImplementation, type);
}

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

xs.addDefaultImplementation(GeoServerInfoImpl.class, GeoServerInfo.class);
xs.addDefaultImplementation(SettingsInfoImpl.class, SettingsInfo.class);
xs.addDefaultImplementation(LoggingInfoImpl.class, LoggingInfo.class);
xs.addDefaultImplementation(JAIInfoImpl.class, JAIInfo.class);
xs.addDefaultImplementation(JAIEXTInfoImpl.class, JAIEXTInfo.class);
xs.addDefaultImplementation(CoverageAccessInfoImpl.class, CoverageAccessInfo.class);
xs.addDefaultImplementation(ContactInfoImpl.class, ContactInfo.class);
xs.addDefaultImplementation(AttributionInfoImpl.class, AttributionInfo.class);
xs.addDefaultImplementation(CatalogImpl.class, Catalog.class);
xs.addDefaultImplementation(NamespaceInfoImpl.class, NamespaceInfo.class);
xs.addDefaultImplementation(WorkspaceInfoImpl.class, WorkspaceInfo.class);
xs.addDefaultImplementation(DataStoreInfoImpl.class, DataStoreInfo.class);
xs.addDefaultImplementation(WMSStoreInfoImpl.class, WMSStoreInfo.class);
xs.addDefaultImplementation(WMTSStoreInfoImpl.class, WMTSStoreInfo.class);
xs.addDefaultImplementation(CoverageStoreInfoImpl.class, CoverageStoreInfo.class);
xs.addDefaultImplementation(StyleInfoImpl.class, StyleInfo.class);
xs.addDefaultImplementation(LegendInfoImpl.class, LegendInfo.class);
xs.addDefaultImplementation(FeatureTypeInfoImpl.class, FeatureTypeInfo.class);
xs.addDefaultImplementation(CoverageInfoImpl.class, CoverageInfo.class);
xs.addDefaultImplementation(WMSLayerInfoImpl.class, WMSLayerInfo.class);
xs.addDefaultImplementation(WMTSLayerInfoImpl.class, WMTSLayerInfo.class);
xs.addDefaultImplementation(CoverageDimensionImpl.class, CoverageDimensionInfo.class);
xs.addDefaultImplementation(MetadataLinkInfoImpl.class, MetadataLinkInfo.class);
xs.addDefaultImplementation(AttributeTypeInfoImpl.class, AttributeTypeInfo.class);
xs.addDefaultImplementation(LayerInfoImpl.class, LayerInfo.class);
xs.addDefaultImplementation(LayerGroupInfoImpl.class, LayerGroupInfo.class);
xs.addDefaultImplementation(LayerIdentifier.class, LayerIdentifierInfo.class);
xs.addDefaultImplementation(AuthorityURL.class, AuthorityURLInfo.class);

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(TreeSet.class, SortedSet.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(TreeSet.class, SortedSet.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(TreeSet.class, SortedSet.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(TreeSet.class, SortedSet.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(TreeSet.class, SortedSet.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(TreeSet.class, SortedSet.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

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

protected void setupDefaultImplementations() {
  if (defaultImplementationsMapper == null) {
    return;
  }
  addDefaultImplementation(HashMap.class, Map.class);
  addDefaultImplementation(ArrayList.class, List.class);
  addDefaultImplementation(HashSet.class, Set.class);
  addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}

代码示例来源:origin: org.geoserver/gwc

@Override
  public XStream getConfiguredXStream(XStream xs) {
    xs.alias("GeoServerTileLayer", GeoServerTileLayerInfo.class);
    xs.addDefaultImplementation(GeoServerTileLayerInfoImpl.class, GeoServerTileLayerInfo.class);
    return xs;
  }
}

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

/**
 * Alias a Class to a shorter name to be used in XML elements.
 *
 * @param name Short name
 * @param type Type to be aliased
 * @param defaultImplementation Default implementation of type to use if no other specified.
 * @throws InitializationException if no {@link DefaultImplementationsMapper} or no {@link ClassAliasingMapper} is
 *             available
 */
public void alias(final String name, final Class<?> type, final Class<?> defaultImplementation) {
  alias(name, type);
  addDefaultImplementation(defaultImplementation, type);
}

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

/**
 * Alias a Class to a shorter name to be used in XML elements.
 *
 * @param name Short name
 * @param type Type to be aliased
 * @param defaultImplementation Default implementation of type to use if no other specified.
 * @throws InitializationException if no {@link DefaultImplementationsMapper} or no {@link ClassAliasingMapper} is available
 */
public void alias(String name, Class type, Class defaultImplementation) {
  alias(name, type);
  addDefaultImplementation(defaultImplementation, type);
}

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

/**
 * Alias a Class to a shorter name to be used in XML elements.
 *
 * @param name Short name
 * @param type Type to be aliased
 * @param defaultImplementation Default implementation of type to use if no other specified.
 * @throws InitializationException if no {@link DefaultImplementationsMapper} or no {@link ClassAliasingMapper} is available
 */
public void alias(String name, Class type, Class defaultImplementation) {
  alias(name, type);
  addDefaultImplementation(defaultImplementation, type);
}

代码示例来源:origin: org.geoserver/gs-restconfig

@Override
public void configurePersister(XStreamPersister persister, XStreamMessageConverter converter) {
  XStream xs = persister.getXStream();
  xs.processAnnotations(ModuleStatus.class);
  xs.allowTypes(new Class[] {ModuleStatus.class});
  xs.alias("about", List.class);
  xs.alias("status", ModuleStatus.class);
  xs.addDefaultImplementation(ModuleStatusImpl.class, ModuleStatus.class);
  xs.addDefaultImplementation(RenderingEngineStatus.class, ModuleStatus.class);
}

代码示例来源:origin: org.geoserver/gs-gwc

@Override
public XStream getConfiguredXStream(XStream xs) {
  xs.alias("GeoServerTileLayer", GeoServerTileLayerInfo.class);
  xs.processAnnotations(GeoServerTileLayerInfoImpl.class);
  xs.processAnnotations(StyleParameterFilter.class);
  xs.addDefaultImplementation(GeoServerTileLayerInfoImpl.class, GeoServerTileLayerInfo.class);
  return xs;
}

代码示例来源:origin: org.geoserver/gs-wms

/**
 * Sets up aliases and allowed types for the xstream persister
 *
 * @param xs
 */
public static void initXStreamPersister(XStreamPersister xp) {
  XStream xs = xp.getXStream();
  xs.alias("wms", WMSInfo.class, WMSInfoImpl.class);
  xs.registerConverter(new WMSInfoConverter(xp));
  xs.addDefaultImplementation(WatermarkInfoImpl.class, WatermarkInfo.class);
  xs.allowTypes(new Class[] {WatermarkInfo.class, WatermarkInfoImpl.class});
}

代码示例来源:origin: org.dataconservancy.reporting/dcs-pkg-ui-reporting-model-builder-xstream

public static XStream newInstance() {
  
  final QNameMap qnames = new QNameMap();
  
  final DcsPullDriver driver = new DcsPullDriver(qnames);
  
  // The XStream Driver
  final XStream x = new XStream(driver);
  x.setMode(XStream.NO_REFERENCES);
  
  x.addDefaultImplementation(IngestReport.class, IngestReport.class);
  x.alias(IngestReportConverter.E_INGEST_REPORT, IngestReport.class);
  x.registerConverter(new IngestReportConverter());
  qnames.registerMapping(new QName(null, IngestReportConverter.E_INGEST_REPORT), IngestReport.class);
  
  return x;
}

代码示例来源:origin: org.geoserver/xslt

@Override
protected void configureXStream(XStream xs) {
  super.configureXStream(xs);
  xs.alias("transform", TransformInfo.class);
  xs.registerConverter(new TransformConverter(xs.getMapper(), xs.getReflectionProvider()));
  xs.registerLocalConverter(TransformInfo.class, "featureType",
      new FeatureTypeLinkConverter());
  xs.addDefaultImplementation(FeatureTypeInfoImpl.class, FeatureTypeInfo.class);
}

相关文章