當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。