org.apache.james.jspf.impl
Class DefaultTermDefinition

java.lang.Object
  extended by org.apache.james.jspf.impl.DefaultTermDefinition
All Implemented Interfaces:
TermDefinition

public class DefaultTermDefinition
extends java.lang.Object
implements TermDefinition

Default implementation for the TermDefinition. This implementation try to retrieve the definition looking up a static REGEX field in the term class.


Constructor Summary
DefaultTermDefinition(java.lang.Class<?> tClass)
           
 
Method Summary
 int getMatchSize()
          Return the number of groups to be expected from the pattern of this Term.
 java.util.regex.Pattern getPattern()
          Retrieve the pattern to be used to match a string against this record type.
 java.lang.Class<?> getTermDef()
          The class implementing this Term type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTermDefinition

public DefaultTermDefinition(java.lang.Class<?> tClass)
                      throws java.lang.IllegalArgumentException,
                             java.lang.SecurityException,
                             java.lang.IllegalAccessException,
                             java.lang.NoSuchFieldException
Throws:
java.lang.IllegalArgumentException
java.lang.SecurityException
java.lang.IllegalAccessException
java.lang.NoSuchFieldException
Method Detail

getPattern

public java.util.regex.Pattern getPattern()
Description copied from interface: TermDefinition
Retrieve the pattern to be used to match a string against this record type.

Specified by:
getPattern in interface TermDefinition
Returns:
the pattern for this term
See Also:
TermDefinition.getPattern()

getTermDef

public java.lang.Class<?> getTermDef()
Description copied from interface: TermDefinition
The class implementing this Term type.

Specified by:
getTermDef in interface TermDefinition
Returns:
the class object.
See Also:
TermDefinition.getTermDef()

getMatchSize

public int getMatchSize()
Description copied from interface: TermDefinition
Return the number of groups to be expected from the pattern of this Term.

Specified by:
getMatchSize in interface TermDefinition
Returns:
the number of groups
See Also:
TermDefinition.getMatchSize()


Copyright © 2006-2010 The Apache Software Foundation. All Rights Reserved.