本文整理匯總了Java中org.codehaus.jackson.map.SerializationConfig.isEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java SerializationConfig.isEnabled方法的具體用法?Java SerializationConfig.isEnabled怎麽用?Java SerializationConfig.isEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.codehaus.jackson.map.SerializationConfig
的用法示例。
在下文中一共展示了SerializationConfig.isEnabled方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _constructWriter
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected BeanPropertyWriter _constructWriter(SerializationConfig paramSerializationConfig, TypeBindings paramTypeBindings, PropertyBuilder paramPropertyBuilder, boolean paramBoolean, String paramString, AnnotatedMember paramAnnotatedMember)
throws JsonMappingException
{
if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS))
paramAnnotatedMember.fixAccess();
JavaType localJavaType = paramAnnotatedMember.getType(paramTypeBindings);
BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType, paramPropertyBuilder.getClassAnnotations(), paramAnnotatedMember);
JsonSerializer localJsonSerializer = findSerializerFromAnnotation(paramSerializationConfig, paramAnnotatedMember, localStd);
boolean bool = ClassUtil.isCollectionMapOrArray(localJavaType.getRawClass());
TypeSerializer localTypeSerializer = null;
if (bool)
localTypeSerializer = findPropertyContentTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd);
BeanPropertyWriter localBeanPropertyWriter = paramPropertyBuilder.buildWriter(paramString, localJavaType, localJsonSerializer, findPropertyTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd), localTypeSerializer, paramAnnotatedMember, paramBoolean);
localBeanPropertyWriter.setViews(paramSerializationConfig.getAnnotationIntrospector().findSerializationViews(paramAnnotatedMember));
return localBeanPropertyWriter;
}
示例2: writeValueWithConf
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
private void writeValueWithConf(JsonGenerator jgen, Object value,
JsonSerialize.Inclusion inc) throws IOException,
JsonGenerationException, JsonMappingException {
SerializationConfig cfg = copySerializationConfig();
cfg = cfg.withSerializationInclusion(inc);
// [JACKSON-96]: allow enabling pretty printing for ObjectMapper
// directly
if (cfg.isEnabled(SerializationConfig.Feature.INDENT_OUTPUT)) {
jgen.useDefaultPrettyPrinter();
}
// [JACKSON-282]: consider Closeable
if (cfg.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE)
&& (value instanceof Closeable)) {
configAndWriteCloseable(jgen, value, cfg);
return;
}
boolean closed = false;
try {
_serializerProvider.serializeValue(cfg, jgen, value,
_serializerFactory);
closed = true;
jgen.close();
} finally {
/*
* won't try to close twice; also, must catch exception (so it
* will not mask exception that is pending)
*/
if (!closed) {
try {
jgen.close();
} catch (IOException ioe) {
}
}
}
}
示例3: processViews
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected void processViews(SerializationConfig paramSerializationConfig, BeanSerializerBuilder paramBeanSerializerBuilder)
{
List localList = paramBeanSerializerBuilder.getProperties();
boolean bool = paramSerializationConfig.isEnabled(SerializationConfig.Feature.DEFAULT_VIEW_INCLUSION);
int i = localList.size();
int j = 0;
BeanPropertyWriter[] arrayOfBeanPropertyWriter = new BeanPropertyWriter[i];
int k = 0;
if (k < i)
{
BeanPropertyWriter localBeanPropertyWriter = (BeanPropertyWriter)localList.get(k);
Class[] arrayOfClass = localBeanPropertyWriter.getViews();
if (arrayOfClass == null)
if (bool)
arrayOfBeanPropertyWriter[k] = localBeanPropertyWriter;
while (true)
{
k++;
break;
j++;
arrayOfBeanPropertyWriter[k] = constructFilteredBeanWriter(localBeanPropertyWriter, arrayOfClass);
}
}
if ((bool) && (j == 0))
return;
paramBeanSerializerBuilder.setFilteredProperties(arrayOfBeanPropertyWriter);
}
示例4: sortBeanProperties
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected List<BeanPropertyWriter> sortBeanProperties(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, List<BeanPropertyWriter> paramList)
{
List localList = paramBasicBeanDescription.findCreatorPropertyNames();
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
AnnotatedClass localAnnotatedClass = paramBasicBeanDescription.getClassInfo();
String[] arrayOfString = localAnnotationIntrospector.findSerializationPropertyOrder(localAnnotatedClass);
Boolean localBoolean = localAnnotationIntrospector.findSerializationSortAlphabetically(localAnnotatedClass);
if (localBoolean == null);
for (boolean bool = paramSerializationConfig.isEnabled(SerializationConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY); ; bool = localBoolean.booleanValue())
{
if ((bool) || (!localList.isEmpty()) || (arrayOfString != null))
paramList = _sortBeanProperties(paramList, localList, arrayOfString, bool);
return paramList;
}
}
示例5: construct
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
public static EnumSerializer construct(Class<Enum<?>> paramClass, SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription)
{
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING));
for (EnumValues localEnumValues = EnumValues.constructFromToString(paramClass, localAnnotationIntrospector); ; localEnumValues = EnumValues.constructFromName(paramClass, localAnnotationIntrospector))
return new EnumSerializer(localEnumValues);
}
示例6: usesStaticTyping
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected boolean usesStaticTyping(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, TypeSerializer paramTypeSerializer, BeanProperty paramBeanProperty)
{
if (paramTypeSerializer != null);
AnnotationIntrospector localAnnotationIntrospector;
JavaType localJavaType;
do
{
do
{
do
{
return false;
localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
JsonSerialize.Typing localTyping = localAnnotationIntrospector.findSerializationTyping(paramBasicBeanDescription.getClassInfo());
if (localTyping != null)
{
if (localTyping == JsonSerialize.Typing.STATIC)
return true;
}
else if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.USE_STATIC_TYPING))
return true;
}
while (paramBeanProperty == null);
localJavaType = paramBeanProperty.getType();
}
while (!localJavaType.isContainerType());
if (localAnnotationIntrospector.findSerializationContentType(paramBeanProperty.getMember(), paramBeanProperty.getType()) != null)
return true;
}
while ((!(localJavaType instanceof MapType)) || (localAnnotationIntrospector.findSerializationKeyType(paramBeanProperty.getMember(), paramBeanProperty.getType()) == null));
return true;
}
示例7: findBeanProperties
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected List<BeanPropertyWriter> findBeanProperties(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription)
throws JsonMappingException
{
VisibilityChecker localVisibilityChecker1 = paramSerializationConfig.getDefaultVisibilityChecker();
if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_GETTERS))
{
JsonAutoDetect.Visibility localVisibility3 = JsonAutoDetect.Visibility.NONE;
localVisibilityChecker1 = localVisibilityChecker1.withGetterVisibility(localVisibility3);
}
if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_IS_GETTERS))
{
JsonAutoDetect.Visibility localVisibility2 = JsonAutoDetect.Visibility.NONE;
localVisibilityChecker1 = localVisibilityChecker1.withIsGetterVisibility(localVisibility2);
}
if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_FIELDS))
{
JsonAutoDetect.Visibility localVisibility1 = JsonAutoDetect.Visibility.NONE;
localVisibilityChecker1 = localVisibilityChecker1.withFieldVisibility(localVisibility1);
}
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
VisibilityChecker localVisibilityChecker2 = localAnnotationIntrospector.findAutoDetectVisibility(paramBasicBeanDescription.getClassInfo(), localVisibilityChecker1);
LinkedHashMap localLinkedHashMap1 = paramBasicBeanDescription.findGetters(localVisibilityChecker2, null);
LinkedHashMap localLinkedHashMap2 = paramBasicBeanDescription.findSerializableFields(localVisibilityChecker2, localLinkedHashMap1.keySet());
removeIgnorableTypes(paramSerializationConfig, paramBasicBeanDescription, localLinkedHashMap1);
removeIgnorableTypes(paramSerializationConfig, paramBasicBeanDescription, localLinkedHashMap2);
ArrayList localArrayList;
if ((localLinkedHashMap1.isEmpty()) && (localLinkedHashMap2.isEmpty()))
localArrayList = null;
while (true)
{
return localArrayList;
boolean bool = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, null, null);
PropertyBuilder localPropertyBuilder = constructPropertyBuilder(paramSerializationConfig, paramBasicBeanDescription);
int i = localLinkedHashMap1.size();
localArrayList = new ArrayList(i);
TypeBindings localTypeBindings = paramBasicBeanDescription.bindingsForBeanType();
Iterator localIterator1 = localLinkedHashMap2.entrySet().iterator();
while (localIterator1.hasNext())
{
Map.Entry localEntry2 = (Map.Entry)localIterator1.next();
AnnotationIntrospector.ReferenceProperty localReferenceProperty2 = localAnnotationIntrospector.findReferenceType((AnnotatedMember)localEntry2.getValue());
if ((localReferenceProperty2 != null) && (localReferenceProperty2.isBackReference()))
continue;
BeanPropertyWriter localBeanPropertyWriter2 = _constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, (String)localEntry2.getKey(), (AnnotatedMember)localEntry2.getValue());
localArrayList.add(localBeanPropertyWriter2);
}
Iterator localIterator2 = localLinkedHashMap1.entrySet().iterator();
while (localIterator2.hasNext())
{
Map.Entry localEntry1 = (Map.Entry)localIterator2.next();
AnnotationIntrospector.ReferenceProperty localReferenceProperty1 = localAnnotationIntrospector.findReferenceType((AnnotatedMember)localEntry1.getValue());
if ((localReferenceProperty1 != null) && (localReferenceProperty1.isBackReference()))
continue;
BeanPropertyWriter localBeanPropertyWriter1 = _constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, (String)localEntry1.getKey(), (AnnotatedMember)localEntry1.getValue());
localArrayList.add(localBeanPropertyWriter1);
}
}
}