本文整理了Java中com.thoughtworks.xstream.XStream.aliasType()
方法的一些代码示例,展示了XStream.aliasType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XStream.aliasType()
方法的具体详情如下:
包路径:com.thoughtworks.xstream.XStream
类名称:XStream
方法名:aliasType
[英]Alias a type to a shorter name to be used in XML elements. Any class that is assignable to this type will be aliased to the same name.
[中]将类型别名为要在XML元素中使用的较短名称。任何可分配给该类型的类都将被别名为相同的名称。
代码示例来源:origin: com.thoughtworks.xstream/xstream
alias("trace", JVM.loadClassForName("java.lang.StackTraceElement"));
alias("currency", JVM.loadClassForName("java.util.Currency"));
aliasType("charset", JVM.loadClassForName("java.nio.charset.Charset"));
aliasType("path", JVM.loadClassForName("java.nio.file.Path"));
alias("year-month", JVM.loadClassForName("java.time.YearMonth"));
alias("zoned-date-time", JVM.loadClassForName("java.time.ZonedDateTime"));
aliasType("zone-id", JVM.loadClassForName("java.time.ZoneId"));
aliasType("chronology", JVM.loadClassForName("java.time.chrono.Chronology"));
alias("hijrah-date", JVM.loadClassForName("java.time.chrono.HijrahDate"));
alias("hijrah-era", JVM.loadClassForName("java.time.chrono.HijrahEra"));
代码示例来源:origin: org.craftercms/crafter-core
@Override
protected void customizeXStream(XStream xstream) {
xstream.alias(ITEM_CLASS_ALIAS, Item.class);
xstream.alias(TREE_CLASS_ALIAS, Tree.class);
xstream.aliasType(DOCUMENT_CLASS_ALIAS, Document.class);
xstream.registerConverter(Dom4jDocumentConverter.INSTANCE);
}
代码示例来源:origin: stackoverflow.com
XStream xstream = new XStream();
xstream.aliasType("Element", Element.class);
xstream.registerConverter(new ElementConverter());
代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio
@Override
public void aliasType(String name, Class type) {
super.aliasType(name, type);
allowTypeHierarchy(type);
}
};
代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio
@Override
public void aliasType(String name, Class type) {
super.aliasType(name, type);
allowTypeHierarchy(type);
}
};
代码示例来源:origin: openl-tablets/openl-tablets
@Override
public void aliasType(String name, Class type) {
super.aliasType(name, type);
allowTypeHierarchy(type);
}
};
代码示例来源:origin: openl-tablets/openl-tablets
@Override
public void aliasType(String name, Class type) {
super.aliasType(name, type);
allowTypeHierarchy(type);
}
};
代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio
public XmlRulesDescriptorSerializer_v5_14() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_14.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_14.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_14.class);
}
}
代码示例来源:origin: openl-tablets/openl-tablets
public XmlRulesDescriptorSerializer_v5_14() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_14.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_14.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_14.class);
}
}
代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio
public XmlRulesDescriptorSerializer_v5_16() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_16.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_16.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_16.class);
xstream.aliasType(MODULE_NAME, RulesDeploy_v5_16.WildcardPattern.class);
xstream.aliasField(LAZY_MODULES_FOR_COMPILATION, RulesDeploy_v5_16.class, "lazyModulesForCompilationPatterns");
xstream.aliasField("name", RulesDeploy_v5_16.WildcardPattern.class, "value");
xstream.useAttributeFor(RulesDeploy_v5_16.WildcardPattern.class, "value");
}
}
代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio
public XmlRulesDescriptorSerializer_v5_15() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_15.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_15.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_15.class);
xstream.aliasType(MODULE_NAME, RulesDeploy_v5_15.WildcardPattern.class);
xstream.aliasField(LAZY_MODULES_FOR_COMPILATION, RulesDeploy_v5_15.class, "lazyModulesForCompilationPatterns");
xstream.aliasField("name", RulesDeploy_v5_15.WildcardPattern.class, "value");
xstream.useAttributeFor(RulesDeploy_v5_15.WildcardPattern.class, "value");
}
}
代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio
public XmlRulesDescriptorSerializer_v5_17() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_17.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_17.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_17.class);
xstream.aliasType(MODULE_NAME, RulesDeploy_v5_17.WildcardPattern.class);
xstream.aliasField(LAZY_MODULES_FOR_COMPILATION, RulesDeploy_v5_17.class, "lazyModulesForCompilationPatterns");
xstream.aliasField("name", RulesDeploy_v5_17.WildcardPattern.class, "value");
xstream.useAttributeFor(RulesDeploy_v5_17.WildcardPattern.class, "value");
}
}
代码示例来源:origin: openl-tablets/openl-tablets
public XmlRulesDescriptorSerializer_v5_16() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_16.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_16.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_16.class);
xstream.aliasType(MODULE_NAME, RulesDeploy_v5_16.WildcardPattern.class);
xstream.aliasField(LAZY_MODULES_FOR_COMPILATION, RulesDeploy_v5_16.class, "lazyModulesForCompilationPatterns");
xstream.aliasField("name", RulesDeploy_v5_16.WildcardPattern.class, "value");
xstream.useAttributeFor(RulesDeploy_v5_16.WildcardPattern.class, "value");
}
}
代码示例来源:origin: openl-tablets/openl-tablets
public XmlRulesDescriptorSerializer_v5_15() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_15.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_15.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_15.class);
xstream.aliasType(MODULE_NAME, RulesDeploy_v5_15.WildcardPattern.class);
xstream.aliasField(LAZY_MODULES_FOR_COMPILATION, RulesDeploy_v5_15.class, "lazyModulesForCompilationPatterns");
xstream.aliasField("name", RulesDeploy_v5_15.WildcardPattern.class, "value");
xstream.useAttributeFor(RulesDeploy_v5_15.WildcardPattern.class, "value");
}
}
代码示例来源:origin: openl-tablets/openl-tablets
public XmlRulesDescriptorSerializer_v5_17() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_17.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy_v5_17.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_17.class);
xstream.aliasType(MODULE_NAME, RulesDeploy_v5_17.WildcardPattern.class);
xstream.aliasField(LAZY_MODULES_FOR_COMPILATION, RulesDeploy_v5_17.class, "lazyModulesForCompilationPatterns");
xstream.aliasField("name", RulesDeploy_v5_17.WildcardPattern.class, "value");
xstream.useAttributeFor(RulesDeploy_v5_17.WildcardPattern.class, "value");
}
}
代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-job
static void alias() {
Run.XSTREAM2.alias("flow-build", WorkflowRun.class);
new XmlFile(null).getXStream().aliasType("flow-owner", Owner.class); // hack! but how else to set it for arbitrary Descriptor’s?
Run.XSTREAM2.aliasType("flow-owner", Owner.class);
}
代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio
public XmlRulesDescriptorSerializer_v5_11() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_11.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_11.class);
}
}
代码示例来源:origin: openl-tablets/openl-tablets
public XmlRulesDescriptorSerializer_v5_11() {
super(new RulesDeployVersionConverter());
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy_v5_11.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy_v5_11.class);
}
}
代码示例来源:origin: org.openl.rules/org.openl.rules.project
public XmlRulesDeploySerializer() {
xstream = new XStream(new DomDriver());
xstream.addPermission(NoTypePermission.NONE);
xstream.allowTypeHierarchy(String.class);
xstream.allowTypeHierarchy(RulesDeploy.PublisherType.class);
xstream.allowTypeHierarchy(RulesDeploy.class);
xstream.allowTypeHierarchy(RulesDeploy.WildcardPattern.class);
xstream.ignoreUnknownElements();
xstream.omitField(RulesDeploy.class, "log");
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasType("publisher", RulesDeploy.PublisherType.class);
xstream.aliasType(RULES_DEPLOY_DESCRIPTOR_TAG, RulesDeploy.class);
xstream.aliasType(MODULE_NAME, RulesDeploy.WildcardPattern.class);
xstream.aliasField(LAZY_MODULES_FOR_COMPILATION, RulesDeploy.class, "lazyModulesForCompilationPatterns");
xstream.aliasField("name", RulesDeploy.WildcardPattern.class, "value");
xstream.useAttributeFor(RulesDeploy.WildcardPattern.class, "value");
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
@Override
protected void registerConverters(XStream xstream) {
super.registerConverters(xstream);
xstream.aliasType("ImmutableList", ImmutableList.class);
xstream.registerConverter(new ImmutableListConverter(xstream.getMapper()));
}
内容来源于网络,如有侵权,请联系作者删除!