public boolean evaluate ( Object feature ) { // Checks to ensure that the attribute has been set if ( attribute == null ) { return false ; } // Note that this converts the attribute to a string // for comparison. Unlike the math or geometry filters, which // require specific types to function correctly, this filter // using the mandatory string representation in Java // Of course, this does not guarantee a meaningful result, but it // does guarantee a valid result. // LOGGER.finest("pattern: " + pattern); // LOGGER.finest("string: " + attribute.getValue(feature)); // return attribute.getValue(feature).toString().matches(pattern); Object value = attribute . evaluate ( feature ) ; if ( null == value ) { return false ; } Matcher matcher = getMatcher ( ) ; matcher . reset ( value . toString ( ) ) ; return matcher . matches ( ) ; }
Determines whether or not a given feature matches this pattern .