final String propType = PROPERTY_VALUE_PROCESSING[index]; final String propName = PROPERTY_VALUE_PROCESSING[index + 1]; final Object propValue = ad.getValue(propName); if (propValue != null && propValue.getClass().isArray()) { type = propType; if ( ad.getValue("propertyPrivate") != null ) { prop.setPrivate(ad.getBooleanValue("propertyPrivate", false)); final ScannedAnnotation[] options = (ScannedAnnotation[])ad.getValue("options"); if (options != null) { final List<String> propertyOptions = new ArrayList<String>();
/** * Get a boolean value of the annotation * @param name The property name * @param defaultValue A default value if the property is not set * @return The property value or the default value. */ public boolean getBooleanValue(final String name, final boolean defaultValue) { final Object val = this.getValue(name); if ( val != null ) { return ((Boolean) val).booleanValue(); } return defaultValue; }
/** * Get an integer value of the annotation * @param name The property name * @param defaultValue A default value if the property is not set * @return The property value or the default value. */ public int getIntegerValue(final String name, final int defaultValue) { final Object val = this.getValue(name); if ( val != null ) { return ((Integer) val).intValue(); } return defaultValue; }
/** * Get a long value of the annotation * @param name The property name * @param defaultValue A default value if the property is not set * @return The property value or the default value. */ public long getLongValue(final String name, final long defaultValue) { final Object val = this.getValue(name); if ( val != null ) { return ((Long) val).intValue(); } return defaultValue; }
/** * Get an enumeration value of the annotation * @param name The property name * @param defaultValue A default value if the property is not set * @return The property value or the default value. */ public String getEnumValue(final String name, final String defaultValue) { final Object val = this.getValue(name); if ( val != null ) { if ( val instanceof String[] ) { return ((String[])val)[1]; } if ( val instanceof String[][] ) { return ((String[][])val)[0][1]; } return val.toString(); } return defaultValue; }
/** * Get a string value of the annotation * @param name The property name * @param defaultValue A default value if the property is not set * @return The property value or the default value. */ public String getStringValue(final String name, final String defaultValue) { final Object val = this.getValue(name); if ( val != null && val.toString().trim().length() > 0 ) { return val.toString().trim(); } return defaultValue; }