当前位置: 首页>>代码示例>>Java>>正文


Java ReflectionProvider类代码示例

本文整理汇总了Java中com.thoughtworks.xstream.converters.reflection.ReflectionProvider的典型用法代码示例。如果您正苦于以下问题:Java ReflectionProvider类的具体用法?Java ReflectionProvider怎么用?Java ReflectionProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReflectionProvider类属于com.thoughtworks.xstream.converters.reflection包,在下文中一共展示了ReflectionProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ToAttributedValueConverter

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
/**
 * Creates a new ToAttributedValueConverter instance.
 * 
 * @param type the type that is handled by this converter instance
 * @param mapper the mapper in use
 * @param reflectionProvider the reflection provider in use
 * @param lookup the converter lookup in use
 * @param valueFieldName the field defining the tag's value (may be null)
 * @param valueDefinedIn the type defining the field
 */
public ToAttributedValueConverter(
        final Class<?> type, final Mapper mapper, final ReflectionProvider reflectionProvider,
        final ConverterLookup lookup, final String valueFieldName, final Class<?> valueDefinedIn) {
    this.type = type;
    this.mapper = mapper;
    this.reflectionProvider = reflectionProvider;
    this.lookup = lookup;

    if (valueFieldName == null) {
        valueField = null;
    } else {
        Field field = null;
        try {
            field = (valueDefinedIn != null ? valueDefinedIn : type).getDeclaredField(valueFieldName);
            if (!field.isAccessible()) {
                field.setAccessible(true);
            }
        } catch (final NoSuchFieldException e) {
            throw new IllegalArgumentException(e.getMessage() + ": " + valueFieldName);
        }
        valueField = field;
    }
    enumMapper = UseAttributeForEnumMapper.createEnumMapper(mapper);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:35,代码来源:ToAttributedValueConverter.java

示例2: XStream

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的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

示例3: IdentifiableToIdConverter

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
/**
 * Creates a new ToAttributedValueConverter instance.
 * 
 * @param mapper the mapper in use
 * @param reflectionProvider the reflection provider in use
 * @param lookup the converter lookup in use
 * @param valueFieldName the field defining the tag's value (may be null)
 * @param valueDefinedIn the type defining the field
 */
public IdentifiableToIdConverter(
    final Class<Identifiable<?>> type, final Mapper mapper, final ReflectionProvider reflectionProvider,
    final ConverterLookup lookup, final String valueFieldName, Class<?> valueDefinedIn) {
    this.type = type;

       Field field = null;
       try {
           field = (valueDefinedIn != null ? valueDefinedIn : type.getSuperclass())
               .getDeclaredField("id");
          
           if (!field.isAccessible()) {
               field.setAccessible(true);
           }
       } catch (NoSuchFieldException e) {
           throw new IllegalArgumentException(e.getMessage() + ": " + valueFieldName);
       }
}
 
开发者ID:alex-bretet,项目名称:cloudstreetmarket.com,代码行数:27,代码来源:IdentifiableToIdConverter.java

示例4: AnnotationMapper

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的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

示例5: XStream

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的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

示例6: AnnotationMapper

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
/**
 * Construct an AnnotationMapper.
 * 
 * @param wrapped the next {@link com.thoughtworks.xstream.mapper.Mapper} in the chain
 * @since 1.3
 */
public AnnotationMapper(
    final Mapper wrapped, final ConverterRegistry converterRegistry, final ConverterLookup converterLookup,
    final XStreamClassLoader classLoader, final ReflectionProvider reflectionProvider,
    final JVM jvm) {
    super(wrapped);
    this.converterRegistry = converterRegistry;
    annotatedTypes.add(Object.class);
    classAliasingMapper = (ClassAliasingMapper) lookupMapperOfType(ClassAliasingMapper.class);
    defaultImplementationsMapper = (DefaultImplementationsMapper) lookupMapperOfType(DefaultImplementationsMapper.class);
    implicitCollectionMapper = (ImplicitCollectionMapper) lookupMapperOfType(ImplicitCollectionMapper.class);
    fieldAliasingMapper = (FieldAliasingMapper) lookupMapperOfType(FieldAliasingMapper.class);
    attributeMapper = (AttributeMapper) lookupMapperOfType(AttributeMapper.class);
    localConversionMapper = (LocalConversionMapper) lookupMapperOfType(LocalConversionMapper.class);
    locked = true;
    arguments = new Object[]{this, classLoader, reflectionProvider, jvm, converterLookup};
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:23,代码来源:AnnotationMapper.java

示例7: ResourceMapper

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
public ResourceMapper(Object jo_packages, boolean isCamel,
		boolean useSingleQuote, boolean compatible, ReflectionProvider reflectionProvider) {
	super(reflectionProvider);
	
	if (jo_packages instanceof Map) {
		this.jo_packages0 = (Map) jo_packages;
	} else {
		if (jo_packages instanceof String) {
			this.jo_packages0 = new LinkedHashMap<String, String>();
			this.jo_packages0.put((String)jo_packages, "");
		}
	}

	jsonc = new JSONSerializer(compatible);
	
	this.isCamel = isCamel;
	this.useSingleQuote = useSingleQuote;
	if (useSingleQuote) {
		jsonc.Q = "'";
	}
	this.registerConverter(new RXConverter(this.getClassMapper()));
	this.setupConverters();
}
 
开发者ID:reflexworks,项目名称:reflexcore,代码行数:24,代码来源:ResourceMapper.java

示例8: XStream

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
public XStream(ReflectionProvider reflectionProvider,
			ClassMapper classMapper, HierarchicalStreamDriver driver,
			String classAttributeIdentifier) {
		jvm = new JVM();
		if (reflectionProvider == null) {
			reflectionProvider = jvm.bestReflectionProvider();
		}
		this.reflectionProvider = reflectionProvider;
		this.hierarchicalStreamDriver = driver;
		//this.classLoaderReference = new ClassLoaderReference(
		//		new CompositeClassLoader());	// サーブレットで実行するとメモリが増えてしまう
		this.classLoaderReference = new ClassLoaderReference(
				getClass().getClassLoader());
		this.classMapper = classMapper == null ? buildMapper(classAttributeIdentifier)
				: classMapper;
		converterLookup = new DefaultConverterLookup(this.classMapper);
		setupAliases();
		setupDefaultImplementations();
		setupConverters();
		setupImmutableTypes();
//		setMode(XPATH_REFERENCES);
		setMode(NO_REFERENCES);
	}
 
开发者ID:reflexworks,项目名称:reflexcore,代码行数:24,代码来源:XStream.java

示例9: AnnotationMapper

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的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

示例10: bestReflectionProvider

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
/**
 * @deprecated As of 1.4.5 use {@link #newReflectionProvider()}
 */
@Deprecated
public synchronized ReflectionProvider bestReflectionProvider() {
    if (reflectionProvider == null) {
        reflectionProvider = newReflectionProvider();
    }
    return reflectionProvider;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:JVM.java

示例11: CubaXStream

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
protected CubaXStream(
        ReflectionProvider reflectionProvider, HierarchicalStreamDriver driver, ClassLoaderReference classLoader,
        Mapper mapper, final CubaXStreamConverterLookup converterLookup) {
    super(reflectionProvider, driver, classLoader, mapper,
            converterLookup::lookupConverterForType,
            converterLookup::registerConverter);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:8,代码来源:CubaXStream.java

示例12: createInstance

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
/**
 * Returns a ReflectionProvider that provides core reflection services.
 *
 * @return configured reflection provider.
 */
@Override
protected final ReflectionProvider createInstance() {
	SortableFieldKeySorter sorter = new SortableFieldKeySorter();

	sorter.registerFieldOrder(TaxonName.class,
			ReflectionProviderFactory.TAXON_NAME_FIELDS);

	FieldDictionary fieldDictionary = new FieldDictionary(sorter);

	ReflectionProvider reflectionProvider
	= new Sun14ReflectionProvider(fieldDictionary);
	return reflectionProvider;
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:19,代码来源:ReflectionProviderFactory.java

示例13: AnnotationReflectionConverter

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
@Deprecated
public AnnotationReflectionConverter(Mapper paramMapper, ReflectionProvider paramReflectionProvider, AnnotationProvider paramAnnotationProvider)
{
  super(paramMapper, paramReflectionProvider);
  this.annotationProvider = paramAnnotationProvider;
  this.cachedConverters = new HashMap();
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:8,代码来源:AnnotationReflectionConverter.java

示例14: bestReflectionProvider

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
public ReflectionProvider bestReflectionProvider()
{
  try
  {
    if (this.reflectionProvider == null)
      this.reflectionProvider = newReflectionProvider();
    ReflectionProvider localReflectionProvider = this.reflectionProvider;
    return localReflectionProvider;
  }
  finally
  {
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:14,代码来源:JVM.java

示例15: createXStream

import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; //导入依赖的package包/类
public XStream createXStream(ReflectionProvider reflectionProvider) {
       return new XStream(reflectionProvider, new DomDriver("UTF-8", new XmlFriendlyNameCoder("__","_"))) {
		@Override
		protected MapperWrapper wrapMapper(MapperWrapper next) {
               return new ApiMapperWrapper(next, apiResponseType);
		}
	};
}
 
开发者ID:Silverpop,项目名称:engage-api-client,代码行数:9,代码来源:XStreamFactory.java


注:本文中的com.thoughtworks.xstream.converters.reflection.ReflectionProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。