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


Java Excluder类代码示例

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


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

示例1: ReflectiveTypeAdapterFactory

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public ReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructor,
    FieldNamingStrategy fieldNamingPolicy, Excluder excluder,
    JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory) {
  this.constructorConstructor = constructorConstructor;
  this.fieldNamingPolicy = fieldNamingPolicy;
  this.excluder = excluder;
  this.jsonAdapterFactory = jsonAdapterFactory;
}
 
开发者ID:PhilipShilling,项目名称:SteamLib,代码行数:9,代码来源:ReflectiveTypeAdapterFactory.java

示例2: createReflectiveTypeAdapterFactory

import com.google.gson.internal.Excluder; //导入依赖的package包/类
protected LaReflectiveTypeAdapterFactory createReflectiveTypeAdapterFactory(Gson newGson, Object factory) {
    final ConstructorConstructor constructorConstructor = getConstructorConstructor(factory);
    final JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory = getJsonAdapterFactory(factory);
    final FieldNamingStrategy fieldNamingStrategy = newGson.fieldNamingStrategy();
    final Excluder excluder = newGson.excluder();
    return new LaReflectiveTypeAdapterFactory(constructorConstructor, fieldNamingStrategy, excluder, jsonAdapterFactory);
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:8,代码来源:GsonJsonEngine.java

示例3: LaReflectiveTypeAdapterFactory

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public LaReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy,
        Excluder excluder, JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory) {
    this.constructorConstructor = constructorConstructor;
    this.fieldNamingPolicy = fieldNamingPolicy;
    this.excluder = excluder;
    this.jsonAdapterFactory = jsonAdapterFactory;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:8,代码来源:LaReflectiveTypeAdapterFactory.java

示例4: GsonBuilder

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public GsonBuilder()
{
    a = Excluder.DEFAULT;
    b = LongSerializationPolicy.DEFAULT;
    c = FieldNamingPolicy.IDENTITY;
    i = 2;
    j = 2;
    m = true;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:10,代码来源:GsonBuilder.java

示例5: testClassAndFieldAreAtSameVersion

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public void testClassAndFieldAreAtSameVersion() throws Exception {
    fr.inria.diversify.testamplification.logger.Logger.writeTestStart(Thread.currentThread(),this, "testClassAndFieldAreAtSameVersion");
    Excluder excluder = Excluder.DEFAULT.withVersion(VERSION);
    fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),3238,excluder,3237,excluder.excludeClass(com.google.gson.VersionExclusionStrategyTest.MockObject.class, true));
    fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),3240,excluder,3239,excluder.excludeField(com.google.gson.VersionExclusionStrategyTest.MockObject.class.getField("someField"), true));
    fr.inria.diversify.testamplification.logger.Logger.writeTestFinish(Thread.currentThread());
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:8,代码来源:VersionExclusionStrategyTest.java

示例6: testClassAndFieldAreBehindInVersion

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public void testClassAndFieldAreBehindInVersion() throws Exception {
    fr.inria.diversify.testamplification.logger.Logger.writeTestStart(Thread.currentThread(),this, "testClassAndFieldAreBehindInVersion");
    Excluder excluder = Excluder.DEFAULT.withVersion(((VERSION) + 2));
    fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),3242,excluder,3241,excluder.excludeClass(com.google.gson.VersionExclusionStrategyTest.MockObject.class, true));
    fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),3244,excluder,3243,excluder.excludeField(com.google.gson.VersionExclusionStrategyTest.MockObject.class.getField("someField"), true));
    fr.inria.diversify.testamplification.logger.Logger.writeTestFinish(Thread.currentThread());
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:8,代码来源:VersionExclusionStrategyTest.java

示例7: testClassAndFieldAreAheadInVersion

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public void testClassAndFieldAreAheadInVersion() throws Exception {
    fr.inria.diversify.testamplification.logger.Logger.writeTestStart(Thread.currentThread(),this, "testClassAndFieldAreAheadInVersion");
    Excluder excluder = Excluder.DEFAULT.withVersion(((VERSION) - 2));
    fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),3234,excluder,3233,excluder.excludeClass(com.google.gson.VersionExclusionStrategyTest.MockObject.class, true));
    fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),3236,excluder,3235,excluder.excludeField(com.google.gson.VersionExclusionStrategyTest.MockObject.class.getField("someField"), true));
    fr.inria.diversify.testamplification.logger.Logger.writeTestFinish(Thread.currentThread());
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:8,代码来源:VersionExclusionStrategyTest.java

示例8: setupGsonSerialiser

import com.google.gson.internal.Excluder; //导入依赖的package包/类
@Override
public void setupGsonSerialiser(GsonBuilder gsonBuilder) {
    new PrivateFields<GsonBuilder, Excluder>(GsonBuilder.class, new Obf("excluder") {}) {}
            .set(gsonBuilder, Excluder.DEFAULT); // grr
    gsonBuilder
            .registerTypeAdapterFactory(new EnumTypeAdapterFactory())
            .registerTypeHierarchyAdapter(Value.class, new ValueSerializer());
}
 
开发者ID:killjoy1221,项目名称:MnM-Utils,代码行数:9,代码来源:SettingsFile.java

示例9: doCreate

import com.google.gson.internal.Excluder; //导入依赖的package包/类
@Override
protected void doCreate(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy, Excluder excluder) {
	registerTypeAdapterFactory(new HyperDataAdapterFactory(constructorConstructor, fieldNamingPolicy, excluder));
	registerTypeAdapter(HyperMap.class, new GsonHyperDataDeserializer());
	registerTypeAdapter(HyperMap.class, new GsonHyperDataSerializer());
	registerTypeAdapter(HyperHashMap.class, new GsonHyperDataDeserializer());
	registerTypeAdapter(HyperHashMap.class, new GsonHyperDataSerializer());
}
 
开发者ID:filip26,项目名称:hyperdata,代码行数:9,代码来源:HyperDataGsonBuilder.java

示例10: Gson

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public Gson() {
    this(Excluder.DEFAULT, FieldNamingPolicy.IDENTITY, Collections.emptyMap(), false, false, false, true, false, false, LongSerializationPolicy.DEFAULT, Collections.emptyList());
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:Gson.java

示例11: ReflectiveTypeAdapterFactory

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public ReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy, Excluder excluder) {
    this.constructorConstructor = constructorConstructor;
    this.fieldNamingPolicy = fieldNamingPolicy;
    this.excluder = excluder;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:6,代码来源:ReflectiveTypeAdapterFactory.java

示例12: Gson

import com.google.gson.internal.Excluder; //导入依赖的package包/类
Gson(final Excluder excluder, final FieldNamingStrategy fieldNamingPolicy,
    final Map<Type, InstanceCreator<?>> instanceCreators, boolean serializeNulls,
    boolean complexMapKeySerialization, boolean generateNonExecutableGson, boolean htmlSafe,
    boolean prettyPrinting, boolean serializeSpecialFloatingPointValues,
    LongSerializationPolicy longSerializationPolicy,
    List<TypeAdapterFactory> typeAdapterFactories) {
  this.constructorConstructor = new ConstructorConstructor(instanceCreators);
  this.serializeNulls = serializeNulls;
  this.generateNonExecutableJson = generateNonExecutableGson;
  this.htmlSafe = htmlSafe;
  this.prettyPrinting = prettyPrinting;

  List<TypeAdapterFactory> factories = new ArrayList<TypeAdapterFactory>();

  // built-in type adapters that cannot be overridden
  factories.add(TypeAdapters.JSON_ELEMENT_FACTORY);
  factories.add(ObjectTypeAdapter.FACTORY);

  // the excluder must precede all adapters that handle user-defined types
  factories.add(excluder);

  // user's type adapters
  factories.addAll(typeAdapterFactories);

  // type adapters for basic platform types
  factories.add(TypeAdapters.STRING_FACTORY);
  factories.add(TypeAdapters.INTEGER_FACTORY);
  factories.add(TypeAdapters.BOOLEAN_FACTORY);
  factories.add(TypeAdapters.BYTE_FACTORY);
  factories.add(TypeAdapters.SHORT_FACTORY);
  factories.add(TypeAdapters.newFactory(long.class, Long.class,
          longAdapter(longSerializationPolicy)));
  factories.add(TypeAdapters.newFactory(double.class, Double.class,
          doubleAdapter(serializeSpecialFloatingPointValues)));
  factories.add(TypeAdapters.newFactory(float.class, Float.class,
          floatAdapter(serializeSpecialFloatingPointValues)));
  factories.add(TypeAdapters.NUMBER_FACTORY);
  factories.add(TypeAdapters.CHARACTER_FACTORY);
  factories.add(TypeAdapters.STRING_BUILDER_FACTORY);
  factories.add(TypeAdapters.STRING_BUFFER_FACTORY);
  factories.add(TypeAdapters.newFactory(BigDecimal.class, TypeAdapters.BIG_DECIMAL));
  factories.add(TypeAdapters.newFactory(BigInteger.class, TypeAdapters.BIG_INTEGER));
  factories.add(TypeAdapters.URL_FACTORY);
  factories.add(TypeAdapters.URI_FACTORY);
  factories.add(TypeAdapters.UUID_FACTORY);
  factories.add(TypeAdapters.LOCALE_FACTORY);
  factories.add(TypeAdapters.INET_ADDRESS_FACTORY);
  factories.add(TypeAdapters.BIT_SET_FACTORY);
  factories.add(DateTypeAdapter.FACTORY);
  factories.add(TypeAdapters.CALENDAR_FACTORY);
  factories.add(TimeTypeAdapter.FACTORY);
  factories.add(SqlDateTypeAdapter.FACTORY);
  factories.add(TypeAdapters.TIMESTAMP_FACTORY);
  factories.add(ArrayTypeAdapter.FACTORY);
  factories.add(TypeAdapters.CLASS_FACTORY);

  // type adapters for composite and user-defined types
  factories.add(new CollectionTypeAdapterFactory(constructorConstructor));
  factories.add(new MapTypeAdapterFactory(constructorConstructor, complexMapKeySerialization));
  factories.add(new JsonAdapterAnnotationTypeAdapterFactory(constructorConstructor));
  factories.add(TypeAdapters.ENUM_FACTORY);
  factories.add(new ReflectiveTypeAdapterFactory(
      constructorConstructor, fieldNamingPolicy, excluder));

  this.factories = Collections.unmodifiableList(factories);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:67,代码来源:Gson.java

示例13: ReflectiveTypeAdapterFactory

import com.google.gson.internal.Excluder; //导入依赖的package包/类
public ReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructor,
    FieldNamingStrategy fieldNamingPolicy, Excluder excluder) {
  this.constructorConstructor = constructorConstructor;
  this.fieldNamingPolicy = fieldNamingPolicy;
  this.excluder = excluder;
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:7,代码来源:ReflectiveTypeAdapterFactory.java

示例14: excludeField

import com.google.gson.internal.Excluder; //导入依赖的package包/类
static boolean excludeField(Field f, boolean serialize, Excluder excluder) {
  return !excluder.excludeClass(f.getType(), serialize) && !excluder.excludeField(f, serialize);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:4,代码来源:ReflectiveTypeAdapterFactory.java

示例15: Gson

import com.google.gson.internal.Excluder; //导入依赖的package包/类
Gson(final Excluder excluder, final FieldNamingStrategy fieldNamingPolicy,
    final Map<Type, InstanceCreator<?>> instanceCreators, boolean serializeNulls,
    boolean complexMapKeySerialization, boolean generateNonExecutableGson, boolean htmlSafe,
    boolean prettyPrinting, boolean serializeSpecialFloatingPointValues,
    LongSerializationPolicy longSerializationPolicy,
    List<TypeAdapterFactory> typeAdapterFactories) {
  this.constructorConstructor = new ConstructorConstructor(instanceCreators);
  this.serializeNulls = serializeNulls;
  this.generateNonExecutableJson = generateNonExecutableGson;
  this.htmlSafe = htmlSafe;
  this.prettyPrinting = prettyPrinting;

  List<TypeAdapterFactory> factories = new ArrayList<TypeAdapterFactory>();

  // built-in type adapters that cannot be overridden
  factories.add(TypeAdapters.JSON_ELEMENT_FACTORY);
  factories.add(ObjectTypeAdapter.FACTORY);

  // the excluder must precede all adapters that handle user-defined types
  factories.add(excluder);

  // user's type adapters
  factories.addAll(typeAdapterFactories);

  // type adapters for basic platform types
  factories.add(TypeAdapters.STRING_FACTORY);
  factories.add(TypeAdapters.INTEGER_FACTORY);
  factories.add(TypeAdapters.BOOLEAN_FACTORY);
  factories.add(TypeAdapters.BYTE_FACTORY);
  factories.add(TypeAdapters.SHORT_FACTORY);
  factories.add(TypeAdapters.newFactory(long.class, Long.class,
          longAdapter(longSerializationPolicy)));
  factories.add(TypeAdapters.newFactory(double.class, Double.class,
          doubleAdapter(serializeSpecialFloatingPointValues)));
  factories.add(TypeAdapters.newFactory(float.class, Float.class,
          floatAdapter(serializeSpecialFloatingPointValues)));
  factories.add(TypeAdapters.NUMBER_FACTORY);
  factories.add(TypeAdapters.CHARACTER_FACTORY);
  factories.add(TypeAdapters.STRING_BUILDER_FACTORY);
  factories.add(TypeAdapters.STRING_BUFFER_FACTORY);
  factories.add(TypeAdapters.newFactory(BigDecimal.class, TypeAdapters.BIG_DECIMAL));
  factories.add(TypeAdapters.newFactory(BigInteger.class, TypeAdapters.BIG_INTEGER));
  factories.add(TypeAdapters.URL_FACTORY);
  factories.add(TypeAdapters.URI_FACTORY);
  factories.add(TypeAdapters.UUID_FACTORY);
  factories.add(TypeAdapters.LOCALE_FACTORY);
  factories.add(TypeAdapters.INET_ADDRESS_FACTORY);
  factories.add(TypeAdapters.BIT_SET_FACTORY);
  factories.add(DateTypeAdapter.FACTORY);
  factories.add(TypeAdapters.CALENDAR_FACTORY);
  factories.add(TimeTypeAdapter.FACTORY);
  factories.add(SqlDateTypeAdapter.FACTORY);
  factories.add(TypeAdapters.TIMESTAMP_FACTORY);
  factories.add(ArrayTypeAdapter.FACTORY);
  factories.add(TypeAdapters.ENUM_FACTORY);
  factories.add(TypeAdapters.CLASS_FACTORY);

  // type adapters for composite and user-defined types
  factories.add(new CollectionTypeAdapterFactory(constructorConstructor));
  factories.add(new MapTypeAdapterFactory(constructorConstructor, complexMapKeySerialization));
  factories.add(new ReflectiveTypeAdapterFactory(
      constructorConstructor, fieldNamingPolicy, excluder));

  this.factories = Collections.unmodifiableList(factories);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:66,代码来源:Gson.java


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