本文整理汇总了Java中com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java Visibility.DEFAULT属性的具体用法?Java Visibility.DEFAULT怎么用?Java Visibility.DEFAULT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility
的用法示例。
在下文中一共展示了Visibility.DEFAULT属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSetterAutoDetected
private static boolean isSetterAutoDetected( RebindConfiguration configuration, PropertyAccessors propertyAccessors, BeanInfo info ) {
if ( !propertyAccessors.getSetter().isPresent() ) {
return false;
}
for ( Class<? extends Annotation> annotation : AUTO_DISCOVERY_ANNOTATIONS ) {
if ( propertyAccessors.isAnnotationPresentOnSetter( annotation ) ) {
return true;
}
}
JMethod setter = propertyAccessors.getSetter().get();
String methodName = setter.getName();
if ( !methodName.startsWith( "set" ) || methodName.length() <= 3 ) {
// no annotation on method and the method does not follow naming convention
return false;
}
JsonAutoDetect.Visibility visibility = info.getSetterVisibility();
if ( Visibility.DEFAULT == visibility ) {
visibility = configuration.getDefaultSetterVisibility();
}
return isAutoDetected( visibility, setter.isPrivate(), setter.isProtected(), setter.isPublic(), setter
.isDefaultAccess() );
}
示例2: isFieldAutoDetected
private static boolean isFieldAutoDetected( RebindConfiguration configuration, PropertyAccessors propertyAccessors, BeanInfo info ) {
if ( !propertyAccessors.getField().isPresent() ) {
return false;
}
for ( Class<? extends Annotation> annotation : AUTO_DISCOVERY_ANNOTATIONS ) {
if ( propertyAccessors.isAnnotationPresentOnField( annotation ) ) {
return true;
}
}
JField field = propertyAccessors.getField().get();
JsonAutoDetect.Visibility visibility = info.getFieldVisibility();
if ( Visibility.DEFAULT == visibility ) {
visibility = configuration.getDefaultFieldVisibility();
}
return isAutoDetected( visibility, field.isPrivate(), field.isProtected(), field.isPublic(), field
.isDefaultAccess() );
}
示例3: Std
/**
* Costructor that will assign given visibility value for all
* properties.
*
* @param v level to use for all property types
*/
public Std(Visibility v)
{
// typically we shouldn't get this value; but let's handle it if we do:
if (v == Visibility.DEFAULT) {
_getterMinLevel = DEFAULT._getterMinLevel;
_isGetterMinLevel = DEFAULT._isGetterMinLevel;
_setterMinLevel = DEFAULT._setterMinLevel;
_creatorMinLevel = DEFAULT._creatorMinLevel;
_fieldMinLevel = DEFAULT._fieldMinLevel;
} else {
_getterMinLevel = v;
_isGetterMinLevel = v;
_setterMinLevel = v;
_creatorMinLevel = v;
_fieldMinLevel = v;
}
}
示例4: isGetterAutoDetected
private static boolean isGetterAutoDetected( RebindConfiguration configuration, PropertyAccessors propertyAccessors, BeanInfo info ) {
if ( !propertyAccessors.getGetter().isPresent() ) {
return false;
}
for ( Class<? extends Annotation> annotation : AUTO_DISCOVERY_ANNOTATIONS ) {
if ( propertyAccessors.isAnnotationPresentOnGetter( annotation ) ) {
return true;
}
}
JMethod getter = propertyAccessors.getGetter().get();
String methodName = getter.getName();
JsonAutoDetect.Visibility visibility;
if ( methodName.startsWith( "is" ) && methodName.length() > 2 && JPrimitiveType.BOOLEAN.equals( getter.getReturnType()
.isPrimitive() ) ) {
// getter method for a boolean
visibility = info.getIsGetterVisibility();
if ( Visibility.DEFAULT == visibility ) {
visibility = configuration.getDefaultIsGetterVisibility();
}
} else if ( methodName.startsWith( "get" ) && methodName.length() > 3 ) {
visibility = info.getGetterVisibility();
if ( Visibility.DEFAULT == visibility ) {
visibility = configuration.getDefaultGetterVisibility();
}
} else {
// no annotation on method and the method does not follow naming convention
return false;
}
return isAutoDetected( visibility, getter.isPrivate(), getter.isProtected(), getter.isPublic(), getter.isDefaultAccess() );
}
示例5: with
public Std with(Visibility v)
{
if (v == Visibility.DEFAULT) {
return DEFAULT;
}
return new Std(v);
}
示例6: withGetterVisibility
public Std withGetterVisibility(Visibility v) {
if (v == Visibility.DEFAULT) v = DEFAULT._getterMinLevel;
if (_getterMinLevel == v) return this;
return new Std(v, _isGetterMinLevel, _setterMinLevel, _creatorMinLevel, _fieldMinLevel);
}
示例7: withIsGetterVisibility
public Std withIsGetterVisibility(Visibility v) {
if (v == Visibility.DEFAULT) v = DEFAULT._isGetterMinLevel;
if (_isGetterMinLevel == v) return this;
return new Std(_getterMinLevel, v, _setterMinLevel, _creatorMinLevel, _fieldMinLevel);
}
示例8: withSetterVisibility
public Std withSetterVisibility(Visibility v) {
if (v == Visibility.DEFAULT) v = DEFAULT._setterMinLevel;
if (_setterMinLevel == v) return this;
return new Std(_getterMinLevel, _isGetterMinLevel, v, _creatorMinLevel, _fieldMinLevel);
}
示例9: withCreatorVisibility
public Std withCreatorVisibility(Visibility v) {
if (v == Visibility.DEFAULT) v = DEFAULT._creatorMinLevel;
if (_creatorMinLevel == v) return this;
return new Std(_getterMinLevel, _isGetterMinLevel, _setterMinLevel, v, _fieldMinLevel);
}
示例10: withFieldVisibility
public Std withFieldVisibility(Visibility v) {
if (v == Visibility.DEFAULT) v = DEFAULT._fieldMinLevel;
if (_fieldMinLevel == v) return this;
return new Std(_getterMinLevel, _isGetterMinLevel, _setterMinLevel, _creatorMinLevel, v);
}