public String getProperty ( String name ) { if ( propertyCache . containsKey ( name ) ) { return ( String ) propertyCache . get ( name ) ; } String [ ] propName = parsePropertyName ( name ) ; // Search for this property by traversing down the XML heirarchy. Element element = doc . getRootElement ( ) ; for ( int i = 0 ; i < propName . length ; i ++ ) { element = element . getChild ( propName [ i ] ) ; if ( element == null ) { // This node doesn't match this part of the property name which // indicates this property doesn't exist so return null. return null ; } } // At this point, we found a matching property, so return its value. // Empty strings are returned as null. String value = element . getText ( ) ; if ( "" . equals ( value ) ) { return null ; } else { // Add to cache so that getting property next time is fast. value = value . trim ( ) ; propertyCache . put ( name , value ) ; return value ; } }
Returns the value of the specified property .