本文整理汇总了Java中com.thoughtworks.xstream.core.ClassLoaderReference类的典型用法代码示例。如果您正苦于以下问题:Java ClassLoaderReference类的具体用法?Java ClassLoaderReference怎么用?Java ClassLoaderReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassLoaderReference类属于com.thoughtworks.xstream.core包,在下文中一共展示了ClassLoaderReference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: XStream
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
private XStream(
final ReflectionProvider reflectionProvider, final HierarchicalStreamDriver driver,
final ClassLoaderReference classLoader, final Mapper mapper,
final DefaultConverterLookup defaultConverterLookup) {
this(reflectionProvider, driver, classLoader, mapper, new ConverterLookup() {
@Override
public Converter lookupConverterForType(final Class<?> type) {
return defaultConverterLookup.lookupConverterForType(type);
}
}, new ConverterRegistry() {
@Override
public void registerConverter(final Converter converter, final int priority) {
defaultConverterLookup.registerConverter(converter, priority);
}
});
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:XStream.java
示例2: AnnotationMapper
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* Construct an AnnotationMapper.
*
* @param wrapped the next {@link Mapper} in the chain
* @since 1.4.5
*/
public AnnotationMapper(
final Mapper wrapped, final ConverterRegistry converterRegistry, final ConverterLookup converterLookup,
final ClassLoaderReference classLoaderReference, final ReflectionProvider reflectionProvider) {
super(wrapped);
this.converterRegistry = converterRegistry;
annotatedTypes.add(Object.class);
setupMappers();
locked = true;
final ClassLoader classLoader = classLoaderReference.getReference();
arguments = new Object[]{
this, classLoaderReference, reflectionProvider, converterLookup, new JVM(), classLoader != null
? classLoader
: new TypedNull<>(ClassLoader.class)};
}
开发者ID:x-stream,项目名称:xstream,代码行数:22,代码来源:AnnotationMapper.java
示例3: setUp
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
protected void setUp() throws Exception {
super.setUp();
final ClassAliasingMapper classAliasingMapper = new ClassAliasingMapper(
new DefaultMapper(new ClassLoaderReference(getClass().getClassLoader())));
classAliasingMapper.addClassAlias("x", X.class);
classAliasingMapper.addClassAlias("software", Software.class);
classAliasingMapper.addClassAlias("open-source", OpenSourceSoftware.class);
mapper = new DefaultImplementationsMapper(new ArrayMapper(classAliasingMapper));
reflectionProvider = new SunUnsafeReflectionProvider();
driver = new XppDriver();
converterLookup = new DefaultConverterLookup();
converterLookup.registerConverter(
new SingleValueConverterWrapper(new StringConverter()), 0);
converterLookup.registerConverter(
new SingleValueConverterWrapper(new IntConverter()), 0);
converterLookup.registerConverter(new ArrayConverter(mapper), 0);
converterLookup.registerConverter(
new ReflectionConverter(mapper, reflectionProvider), -1);
}
开发者ID:x-stream,项目名称:xstream,代码行数:23,代码来源:ToAttributedValueConverterTest.java
示例4: XStream
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
public XStream(ReflectionProvider paramReflectionProvider, HierarchicalStreamDriver paramHierarchicalStreamDriver, ClassLoaderReference paramClassLoaderReference, Mapper paramMapper, ConverterLookup paramConverterLookup, ConverterRegistry paramConverterRegistry)
{
if (paramReflectionProvider == null)
paramReflectionProvider = JVM.newReflectionProvider();
this.reflectionProvider = paramReflectionProvider;
this.hierarchicalStreamDriver = paramHierarchicalStreamDriver;
this.classLoaderReference = paramClassLoaderReference;
this.converterLookup = paramConverterLookup;
this.converterRegistry = paramConverterRegistry;
Mapper localMapper;
if (paramMapper == null)
localMapper = buildMapper();
else
localMapper = paramMapper;
this.mapper = localMapper;
setupMappers();
setupSecurity();
setupAliases();
setupDefaultImplementations();
setupConverters();
setupImmutableTypes();
setMode(1003);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:24,代码来源:XStream.java
示例5: getInstance
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
public static CustomObjectInputStream getInstance(DataHolder paramDataHolder, StreamCallback paramStreamCallback, ClassLoaderReference paramClassLoaderReference)
{
try
{
CustomObjectInputStream localCustomObjectInputStream1 = (CustomObjectInputStream)paramDataHolder.get(DATA_HOLDER_KEY);
CustomObjectInputStream localCustomObjectInputStream2 = localCustomObjectInputStream1;
if (localCustomObjectInputStream1 == null)
{
localCustomObjectInputStream2 = new CustomObjectInputStream(paramStreamCallback, paramClassLoaderReference);
paramDataHolder.put(DATA_HOLDER_KEY, localCustomObjectInputStream2);
}
else
{
localCustomObjectInputStream2.pushCallback(paramStreamCallback);
}
return localCustomObjectInputStream2;
}
catch (IOException localIOException)
{
throw new ConversionException("Cannot create CustomObjectStream", localIOException);
}
finally
{
}
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:26,代码来源:CustomObjectInputStream.java
示例6: AnnotationMapper
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* Construct an AnnotationMapper.
*
* @param wrapped the next {@link Mapper} in the chain
* @since 1.4.5
*/
public AnnotationMapper(
final Mapper wrapped, final ConverterRegistry converterRegistry, final ConverterLookup converterLookup,
final ClassLoaderReference classLoaderReference, final ReflectionProvider reflectionProvider) {
super(wrapped);
this.converterRegistry = converterRegistry;
annotatedTypes.add(Object.class);
setupMappers();
locked = true;
final ClassLoader classLoader = classLoaderReference.getReference();
arguments = new Object[]{
this, classLoaderReference, reflectionProvider, converterLookup, new JVM(),
classLoader != null ? classLoader : new TypedNull<ClassLoader>(ClassLoader.class)};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:AnnotationMapper.java
示例7: readObject
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
setupMappers();
final int max = in.readInt();
arguments = new Object[max + 2];
for (int i = 0; i < max; i++) {
arguments[i] = in.readObject();
if (arguments[i] instanceof ClassLoaderReference) {
arguments[max + 1] = ((ClassLoaderReference)arguments[i]).getReference();
}
}
arguments[max] = new JVM();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:AnnotationMapper.java
示例8: getInstance
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
public static synchronized CustomObjectInputStream getInstance(final DataHolder whereFrom,
final CustomObjectInputStream.StreamCallback callback, final ClassLoaderReference classLoaderReference) {
try {
CustomObjectInputStream result = (CustomObjectInputStream)whereFrom.get(DATA_HOLDER_KEY);
if (result == null) {
result = new CustomObjectInputStream(callback, classLoaderReference);
whereFrom.put(DATA_HOLDER_KEY, result);
} else {
result.pushCallback(callback);
}
return result;
} catch (final IOException e) {
throw new ConversionException("Cannot create CustomObjectStream", e);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:CustomObjectInputStream.java
示例9: CustomObjectInputStream
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* Warning, this object is expensive to create (due to functionality inherited from superclass). Use the static
* fetch() method instead, wherever possible.
*
* @see #getInstance(DataHolder, StreamCallback, ClassLoaderReference)
*/
public CustomObjectInputStream(final StreamCallback callback, final ClassLoaderReference classLoaderReference)
throws IOException, SecurityException {
super();
callbacks.push(callback);
this.classLoaderReference = classLoaderReference;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:CustomObjectInputStream.java
示例10: CubaXStream
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
public CubaXStream(List<Class> excluded) {
this(null,
new XppDriver(),
new ClassLoaderReference(Thread.currentThread().getContextClassLoader()),
null,
new CubaXStreamConverterLookup(excluded));
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:8,代码来源:CubaXStream.java
示例11: createStringPlan
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* 将执行计划序列化成字符串
*/
public static String createStringPlan(PhysicalPlan plan)
{
XStream xstream = new XStream(new DomDriver(XML_CHARSET));
xstream.autodetectAnnotations(true);
PhysicalPlanLoader.setAlias(xstream);
xstream.registerConverter(new MapConverter(new DefaultMapper(new ClassLoaderReference(PhysicalPlanWriter.class.getClassLoader()))));
return xstream.toXML(plan);
}
开发者ID:HuaweiBigData,项目名称:StreamCQL,代码行数:12,代码来源:PhysicalPlanWriter.java
示例12: CustomObjectInputStream
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* Warning, this object is expensive to create (due to functionality inherited from superclass). Use the static
* fetch() method instead, wherever possible.
*
* @see #getInstance(DataHolder, StreamCallback, ClassLoaderReference)
*/
public CustomObjectInputStream(final StreamCallback callback, final ClassLoaderReference classLoaderReference)
throws IOException, SecurityException {
super();
callbacks.push(callback);
this.classLoaderReference = classLoaderReference;
}
开发者ID:x-stream,项目名称:xstream,代码行数:13,代码来源:CustomObjectInputStream.java
示例13: testOwnMapperChainCanBeRegistered
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
public void testOwnMapperChainCanBeRegistered() {
ClassLoaderReference classLoaderReference = new ClassLoaderReference(getClass().getClassLoader());
Mapper mapper = new DefaultMapper(classLoaderReference);
xstream = new XStream(new PureJavaReflectionProvider(), new DomDriver(), getClass().getClassLoader(), mapper);
String expected = "" +
"<com.thoughtworks.acceptance.objects.Software>\n" +
" <vendor>ms</vendor>\n" +
" <name>word</name>\n" +
"</com.thoughtworks.acceptance.objects.Software>";
assertEquals(expected, xstream.toXML(new Software("ms", "word")));
}
开发者ID:x-stream,项目名称:xstream,代码行数:13,代码来源:CustomMapperTest.java
示例14: readObject
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
private void readObject(ObjectInputStream paramObjectInputStream)
{
paramObjectInputStream.defaultReadObject();
setupMappers();
int i = paramObjectInputStream.readInt();
this.arguments = new Object[i + 2];
for (int j = 0; j < i; j++)
{
this.arguments[j] = paramObjectInputStream.readObject();
if ((this.arguments[j] instanceof ClassLoaderReference))
this.arguments[(i + 1)] = ((ClassLoaderReference)this.arguments[j]).getReference();
}
this.arguments[i] = new JVM();
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:15,代码来源:AnnotationMapper.java
示例15: getXStream
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
private static XStream getXStream() {
XStream xstream = new XStream(null, new XppDriver(),new ClassLoaderReference(MyDBI.class.getClassLoader()));
xstream.omitField(MyDBI.class, "conn");
xstream.omitField(MyDBI.class, "dbUsername");
xstream.omitField(MyDBI.class, "dbPassword");
xstream.omitField(MyDBI.class, "dbPath");
xstream.omitField(MyDBI.class, "path2XmlFile");
xstream.omitField(MyDBI.class, "isServerConnection");
xstream.omitField(MyDBI.class, "isAdminConnection");
xstream.omitField(MyDBI.class, "passFalse");
xstream.omitField(MyDBI.class, "filledHashtables");
xstream.omitField(MyDBTablesNew.class, "isPmm");
xstream.omitField(MyDBTablesNew.class, "isKrise");
xstream.omitField(MyDBTablesNew.class, "isSiLeBAT");
//xstream.omitField(MyTable.class, "rowHeights");
xstream.omitField(MyTable.class, "colWidths");
xstream.omitField(MyTable.class, "sortKeyList");
xstream.omitField(MyTable.class, "searchString");
xstream.omitField(MyTable.class, "selectedRow");
xstream.omitField(MyTable.class, "selectedCol");
xstream.omitField(MyTable.class, "verticalScrollerPosition");
xstream.omitField(MyTable.class, "horizontalScrollerPosition");
xstream.omitField(MyTable.class, "form_SelectedID");
xstream.omitField(MyTable.class, "caller4Trigger");
xstream.omitField(MyTable.class, "mnSQL");
return xstream;
}
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:28,代码来源:XmlLoader.java
示例16: initXStream
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
protected void initXStream() {
_xStream = new XStream(null, new XppDriver(), new ClassLoaderReference(
XStreamConfiguratorRegistryUtil.getConfiguratorsClassLoader(XStream.class.getClassLoader())));
_xStream.omitField(HashMap.class, "cache_bitmask");
Set<XStreamConfigurator> xStreamConfigurators = XStreamConfiguratorRegistryUtil.getXStreamConfigurators();
if (SetUtil.isEmpty(xStreamConfigurators)) {
return;
}
List<String> allowedTypeNames = new ArrayList<>();
for (XStreamConfigurator xStreamConfigurator : xStreamConfigurators) {
List<XStreamAlias> xStreamAliases = xStreamConfigurator.getXStreamAliases();
if (ListUtil.isNotEmpty(xStreamAliases)) {
for (XStreamAlias xStreamAlias : xStreamAliases) {
_xStream.alias(xStreamAlias.getName(), xStreamAlias.getClazz());
}
}
List<XStreamConverter> xStreamConverters = xStreamConfigurator.getXStreamConverters();
if (ListUtil.isNotEmpty(xStreamConverters)) {
for (XStreamConverter xStreamConverter : xStreamConverters) {
_xStream.registerConverter(new ConverterAdapter(xStreamConverter), XStream.PRIORITY_VERY_HIGH);
}
}
List<XStreamType> xStreamTypes = xStreamConfigurator.getAllowedXStreamTypes();
if (ListUtil.isNotEmpty(xStreamTypes)) {
for (XStreamType xStreamType : xStreamTypes) {
allowedTypeNames.add(xStreamType.getTypeExpression());
}
}
}
// For default permissions, first wipe than add default
_xStream.addPermission(NoTypePermission.NONE);
// Add permissions
_xStream.addPermission(PrimitiveTypePermission.PRIMITIVES);
_xStream.addPermission(XStreamStagedModelTypeHierarchyPermission.STAGED_MODELS);
_xStream.allowTypes(_XSTREAM_DEFAULT_ALLOWED_TYPES);
_xStream.allowTypeHierarchy(List.class);
_xStream.allowTypeHierarchy(Map.class);
_xStream.allowTypeHierarchy(Timestamp.class);
_xStream.allowTypeHierarchy(Set.class);
_xStream.allowTypes(allowedTypeNames.toArray(new String[0]));
_xStream.allowTypesByWildcard(new String[] { "com.thoughtworks.xstream.mapper.DynamicProxyMapper*" });
}
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:62,代码来源:BaseExportImportController.java
示例17: SerializableConverter
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* @deprecated As of 1.4.5 use {@link #SerializableConverter(Mapper, ReflectionProvider, ClassLoaderReference)}
*/
@Deprecated
public SerializableConverter(
final Mapper mapper, final ReflectionProvider reflectionProvider, final ClassLoader classLoader) {
this(mapper, reflectionProvider, new ClassLoaderReference(classLoader));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:SerializableConverter.java
示例18: ExternalizableConverter
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* @deprecated As of 1.4.5 use {@link #ExternalizableConverter(Mapper, ClassLoaderReference)}
*/
@Deprecated
public ExternalizableConverter(final Mapper mapper, final ClassLoader classLoader) {
this(mapper, new ClassLoaderReference(classLoader));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ExternalizableConverter.java
示例19: DynamicProxyConverter
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* @deprecated As of 1.4.5 use {@link #DynamicProxyConverter(Mapper, ClassLoaderReference)}
*/
@Deprecated
public DynamicProxyConverter(final Mapper mapper, final ClassLoader classLoader) {
this(mapper, new ClassLoaderReference(classLoader));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:DynamicProxyConverter.java
示例20: JavaClassConverter
import com.thoughtworks.xstream.core.ClassLoaderReference; //导入依赖的package包/类
/**
* @deprecated As of 1.4.5 use {@link #JavaClassConverter(ClassLoaderReference)}
*/
@Deprecated
public JavaClassConverter(final ClassLoader classLoader) {
this(new ClassLoaderReference(classLoader));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:JavaClassConverter.java
注:本文中的com.thoughtworks.xstream.core.ClassLoaderReference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论