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


Java Visibility.DEFAULT属性代码示例

本文整理汇总了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() );
}
 
开发者ID:nmorel,项目名称:gwt-jackson,代码行数:26,代码来源:PropertyProcessor.java

示例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() );
}
 
开发者ID:nmorel,项目名称:gwt-jackson,代码行数:20,代码来源:PropertyProcessor.java

示例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;
          }
      }
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:23,代码来源:VisibilityChecker.java

示例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() );
}
 
开发者ID:nmorel,项目名称:gwt-jackson,代码行数:37,代码来源:PropertyProcessor.java

示例5: with

public Std with(Visibility v)
{
    if (v == Visibility.DEFAULT) {
        return DEFAULT;
    }
    return new Std(v);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:7,代码来源:VisibilityChecker.java

示例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);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:5,代码来源:VisibilityChecker.java

示例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);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:5,代码来源:VisibilityChecker.java

示例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);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:5,代码来源:VisibilityChecker.java

示例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);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:5,代码来源:VisibilityChecker.java

示例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);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:5,代码来源:VisibilityChecker.java


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