Version: 1.1.1

ca.ucalgary.seahawk.services
Class MobyComplexBuilder

java.lang.Object
  extended by ca.ucalgary.seahawk.services.MobyComplexBuilder

public class MobyComplexBuilder
extends Object

Class used by MobyClient to build the MOBY rule database from a configuration file.


Field Summary
static String ANON_ARTICLE
           
static String INHERITED_MEMBERS_SENTINEL
           
static String PRIMITIVE_VALUE_SENTINEL
           
 
Constructor Summary
MobyComplexBuilder(String dataType, Map<String,String[]> members, Map<String,String> nameSpaces, MobyClient cl)
           
MobyComplexBuilder(String dataType, Map<String,String[]> members, Map<String,String> nameSpaces, MobyClient cl, String articleName)
           
 
Method Summary
 MobyDataObject apply(Matcher matcher)
           
 MobyDataObject apply(Matcher matcher, byte[] data)
           
 MobyDataObject applyXPath(Object result, NamespaceContext nsContext)
           
 String[] evaluateIterativeRule(Matcher matcher, String result, String whitespaceMode, String encodingMode, byte[] data)
           
 MobyDataType getDataType()
          Reports the data type of the objects returned by matched rules.
 MobyNamespace[] getNamespaces()
          Reports the possible namespaces of the objects returned by matched rules.
 String getURN()
          Reports the URN identifying the rule, or null if it doesn't exist.
 int requiredXPathContext()
          Call to find out if the result will be a String or NodeList, etc if there's an XPath.
 void setURN(String urn)
          Call in order to provide a unique ID for the rule, for reuse purposes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANON_ARTICLE

public static final String ANON_ARTICLE
See Also:
Constant Field Values

INHERITED_MEMBERS_SENTINEL

public static final String INHERITED_MEMBERS_SENTINEL
See Also:
Constant Field Values

PRIMITIVE_VALUE_SENTINEL

public static final String PRIMITIVE_VALUE_SENTINEL
See Also:
Constant Field Values
Constructor Detail

MobyComplexBuilder

public MobyComplexBuilder(String dataType,
                          Map<String,String[]> members,
                          Map<String,String> nameSpaces,
                          MobyClient cl)
                   throws Exception
Throws:
Exception

MobyComplexBuilder

public MobyComplexBuilder(String dataType,
                          Map<String,String[]> members,
                          Map<String,String> nameSpaces,
                          MobyClient cl,
                          String articleName)
                   throws Exception
Throws:
Exception
Method Detail

apply

public MobyDataObject apply(Matcher matcher)
                     throws MobyException
Throws:
MobyException

apply

public MobyDataObject apply(Matcher matcher,
                            byte[] data)
                     throws MobyException
Throws:
MobyException

evaluateIterativeRule

public String[] evaluateIterativeRule(Matcher matcher,
                                      String result,
                                      String whitespaceMode,
                                      String encodingMode,
                                      byte[] data)
                               throws MobyException,
                                      Exception
Returns:
a list of rule values to interpret
Throws:
MobyException
Exception

applyXPath

public MobyDataObject applyXPath(Object result,
                                 NamespaceContext nsContext)
                          throws MobyException,
                                 XPathExpressionException
Throws:
MobyException
XPathExpressionException

getDataType

public MobyDataType getDataType()
Reports the data type of the objects returned by matched rules.


getNamespaces

public MobyNamespace[] getNamespaces()
Reports the possible namespaces of the objects returned by matched rules.


getURN

public String getURN()
Reports the URN identifying the rule, or null if it doesn't exist. Useful for rule-sharing purposes.


setURN

public void setURN(String urn)
Call in order to provide a unique ID for the rule, for reuse purposes.


requiredXPathContext

public int requiredXPathContext()
Call to find out if the result will be a String or NodeList, etc if there's an XPath.

Returns:
one of the constants (NODESET, STRING) from javax.xml.xpath.XPathConstants, or 0 if not an XPath rule

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010