uk.org.jcam.processor.dataObjects
Class Template

java.lang.Object
  extended by uk.org.jcam.processor.dataObjects.Template
All Implemented Interfaces:
java.lang.Cloneable

public class Template
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
static java.lang.String ATTR_ACTION
           
static java.lang.String ATTR_ACTION_PREFIX
           
static java.lang.String ATTR_CONDITION
           
static java.lang.String ATTR_ITEM
           
static java.lang.String ATTR_SCOPE
           
static java.lang.String CAM_NAMESPACE_PREFIX
           
static java.lang.String CAMURI
           
static java.lang.String CONST_AND_STRING
           
static java.lang.String CONST_DECENDANT_OR_SELF_STRING
           
static char CONST_VARIABLE_PREFEX_CHAR
           
static java.lang.String CONST_VARIABLE_PREFEX_STRING
           
static java.lang.String ELEM_ACTION
           
static java.lang.String ELEM_CONSTRAINT
           
static java.lang.String ELEM_CONTEXT
           
static java.lang.String ELEM_DECLARATION
           
static java.lang.String ELEM_EMPTY
           
 boolean firstFailureEndsIt
           
static org.jdom.Namespace ns
           
static java.lang.String VALUE_PLACEHOLDER
           
static java.lang.String XPATH_CONTEXT_RULES
           
static java.lang.String XPATH_DATAVALIDATIONS
           
static java.lang.String XPATH_DATAVALIDATIONS_TYPE
           
static java.lang.String XPATH_DEFAULT_RULES
           
static java.lang.String XPATH_EXTERNALMAPPINGS
           
static java.lang.String XPATH_PARAMETERS
           
static java.lang.String XPATH_RULES
           
static java.lang.String XPATH_STRUCTURE
           
 
Constructor Summary
Template()
           
 
Method Summary
 java.lang.Object clone()
           
 boolean dataValidationsExist()
           
 java.util.List getAllContextSpecificRules()
           
 org.jdom.Element getContentReference()
           
 java.util.List getContentReferenceItems()
           
 org.jdom.Element getDataValidations()
           
 org.jdom.Element getDataValidationsType()
           
 org.jdom.Element getDefaultRules()
           
 org.jdom.Element getExternalMappings()
           
 Parameters getParameters()
           
 java.util.List getRegistries()
           
 org.jdom.Element getRules()
           
 java.util.List getScopedContextSpecificRules()
           
 java.util.List getScopedContextSpecificRules(java.lang.String scope)
           
 org.jdom.Element getStructure()
           
 org.jdom.Element getStructure(java.lang.String ID)
           
 org.jdom.Document getTemplate()
           
 java.util.List getUnscopedContextSpecificRules()
           
 Xpath getXpath()
           
 boolean isElementInTemplate(org.jdom.Element xmlFileElement)
          checkElementInTemplate
 void outputStructure(java.lang.String filename)
           
 void outputStructure(java.lang.String filename, java.lang.String ID)
           
 void outputTemplate(java.lang.String filename)
          Output the CAMtemplate.template to the file named filename
 void setFirstFailureEndsIt(boolean b)
          setFirstFailureEndsIt
 void setParameterValueFromXML(org.jdom.Element elm)
           
 void setParameterValues(java.lang.String[] args)
           
 void setTemplate(org.jdom.Document template)
           
 void setUpParameters()
          creates CAMparameters based on values from the XML Instance File
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_ACTION

public static final java.lang.String ATTR_ACTION
See Also:
Constant Field Values

ATTR_ACTION_PREFIX

public static final java.lang.String ATTR_ACTION_PREFIX
See Also:
Constant Field Values

ATTR_CONDITION

public static final java.lang.String ATTR_CONDITION
See Also:
Constant Field Values

ATTR_ITEM

public static final java.lang.String ATTR_ITEM
See Also:
Constant Field Values

ATTR_SCOPE

public static final java.lang.String ATTR_SCOPE
See Also:
Constant Field Values

CAM_NAMESPACE_PREFIX

public static final java.lang.String CAM_NAMESPACE_PREFIX
See Also:
Constant Field Values

CAMURI

public static final java.lang.String CAMURI
See Also:
Constant Field Values

CONST_AND_STRING

public static final java.lang.String CONST_AND_STRING
See Also:
Constant Field Values

CONST_DECENDANT_OR_SELF_STRING

public static final java.lang.String CONST_DECENDANT_OR_SELF_STRING
See Also:
Constant Field Values

CONST_VARIABLE_PREFEX_CHAR

public static final char CONST_VARIABLE_PREFEX_CHAR
See Also:
Constant Field Values

CONST_VARIABLE_PREFEX_STRING

public static final java.lang.String CONST_VARIABLE_PREFEX_STRING
See Also:
Constant Field Values

ELEM_ACTION

public static final java.lang.String ELEM_ACTION
See Also:
Constant Field Values

ELEM_CONSTRAINT

public static final java.lang.String ELEM_CONSTRAINT
See Also:
Constant Field Values

ELEM_CONTEXT

public static final java.lang.String ELEM_CONTEXT
See Also:
Constant Field Values

ELEM_DECLARATION

public static final java.lang.String ELEM_DECLARATION
See Also:
Constant Field Values

ELEM_EMPTY

public static final java.lang.String ELEM_EMPTY
See Also:
Constant Field Values

ns

public static final org.jdom.Namespace ns

VALUE_PLACEHOLDER

public static final java.lang.String VALUE_PLACEHOLDER
See Also:
Constant Field Values

XPATH_CONTEXT_RULES

public static final java.lang.String XPATH_CONTEXT_RULES
See Also:
Constant Field Values

XPATH_DEFAULT_RULES

public static final java.lang.String XPATH_DEFAULT_RULES
See Also:
Constant Field Values

XPATH_PARAMETERS

public static final java.lang.String XPATH_PARAMETERS
See Also:
Constant Field Values

XPATH_RULES

public static final java.lang.String XPATH_RULES
See Also:
Constant Field Values

XPATH_DATAVALIDATIONS

public static final java.lang.String XPATH_DATAVALIDATIONS
See Also:
Constant Field Values

XPATH_EXTERNALMAPPINGS

public static final java.lang.String XPATH_EXTERNALMAPPINGS
See Also:
Constant Field Values

XPATH_DATAVALIDATIONS_TYPE

public static final java.lang.String XPATH_DATAVALIDATIONS_TYPE
See Also:
Constant Field Values

XPATH_STRUCTURE

public static final java.lang.String XPATH_STRUCTURE
See Also:
Constant Field Values

firstFailureEndsIt

public boolean firstFailureEndsIt
Constructor Detail

Template

public Template()
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getAllContextSpecificRules

public java.util.List getAllContextSpecificRules()
                                          throws org.jdom.JDOMException,
                                                 Parameters.ParametersException,
                                                 org.jaxen.JaxenException
Returns:
returns the structure part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getContentReference

public org.jdom.Element getContentReference()
                                     throws org.jdom.JDOMException,
                                            Parameters.ParametersException,
                                            org.jaxen.JaxenException
Returns:
returns the ContentReference part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getDataValidations

public org.jdom.Element getDataValidations()
                                    throws org.jdom.JDOMException,
                                           Parameters.ParametersException,
                                           org.jaxen.JaxenException
Returns:
returns the ContentReference part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getDataValidationsType

public org.jdom.Element getDataValidationsType()
                                        throws Parameters.ParametersException,
                                               org.jaxen.JaxenException,
                                               org.jdom.JDOMException
Throws:
Parameters.ParametersException
org.jaxen.JaxenException
org.jdom.JDOMException

dataValidationsExist

public boolean dataValidationsExist()
                             throws Parameters.ParametersException,
                                    org.jaxen.JaxenException,
                                    org.jdom.JDOMException
Throws:
Parameters.ParametersException
org.jaxen.JaxenException
org.jdom.JDOMException

getExternalMappings

public org.jdom.Element getExternalMappings()
                                     throws org.jdom.JDOMException,
                                            Parameters.ParametersException,
                                            org.jaxen.JaxenException
Throws:
org.jdom.JDOMException
Parameters.ParametersException
org.jaxen.JaxenException

getContentReferenceItems

public java.util.List getContentReferenceItems()
                                        throws org.jdom.JDOMException,
                                               Parameters.ParametersException,
                                               org.jaxen.JaxenException
Returns:
returns the ContentReference part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getDefaultRules

public org.jdom.Element getDefaultRules()
                                 throws org.jdom.JDOMException,
                                        Parameters.ParametersException,
                                        org.jaxen.JaxenException
Returns:
returns the structure part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getParameters

public Parameters getParameters()
Returns:
Parameters

getRegistries

public java.util.List getRegistries()
Returns:
Returns the registries.

getScopedContextSpecificRules

public java.util.List getScopedContextSpecificRules()
                                             throws org.jdom.JDOMException,
                                                    Parameters.ParametersException,
                                                    org.jaxen.JaxenException
Returns:
returns the structure part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getScopedContextSpecificRules

public java.util.List getScopedContextSpecificRules(java.lang.String scope)
                                             throws org.jdom.JDOMException,
                                                    Parameters.ParametersException,
                                                    org.jaxen.JaxenException
Returns:
returns the structure part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getStructure

public org.jdom.Element getStructure()
                              throws org.jdom.JDOMException,
                                     Parameters.ParametersException,
                                     org.jaxen.JaxenException
Returns:
Element
Throws:
org.jdom.JDOMException
Parameters.ParametersException
org.jaxen.JaxenException

getStructure

public org.jdom.Element getStructure(java.lang.String ID)
                              throws org.jdom.JDOMException,
                                     Parameters.ParametersException,
                                     org.jaxen.JaxenException
Parameters:
ID -
Returns:
Element
Throws:
org.jdom.JDOMException
Parameters.ParametersException
org.jaxen.JaxenException

getTemplate

public org.jdom.Document getTemplate()
Returns:
Document

getUnscopedContextSpecificRules

public java.util.List getUnscopedContextSpecificRules()
                                               throws org.jdom.JDOMException,
                                                      Parameters.ParametersException,
                                                      org.jaxen.JaxenException
Returns:
returns the structure part of the template
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

getXpath

public Xpath getXpath()
Returns:
XPath

isElementInTemplate

public boolean isElementInTemplate(org.jdom.Element xmlFileElement)
                            throws NamespaceException,
                                   org.jdom.JDOMException,
                                   Parameters.ParametersException,
                                   org.jaxen.JaxenException
checkElementInTemplate

Parameters:
xC -
Throws:
org.jaxen.JaxenException
NamespaceException
org.jdom.JDOMException
Parameters.ParametersException

outputStructure

public void outputStructure(java.lang.String filename)
                     throws org.jdom.JDOMException,
                            Parameters.ParametersException,
                            org.jaxen.JaxenException
Parameters:
filename -
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

outputStructure

public void outputStructure(java.lang.String filename,
                            java.lang.String ID)
                     throws org.jdom.JDOMException,
                            Parameters.ParametersException,
                            org.jaxen.JaxenException
Parameters:
filename -
Throws:
org.jaxen.JaxenException
org.jdom.JDOMException
Parameters.ParametersException

outputTemplate

public void outputTemplate(java.lang.String filename)
Output the CAMtemplate.template to the file named filename

Parameters:
filename -

setFirstFailureEndsIt

public void setFirstFailureEndsIt(boolean b)
setFirstFailureEndsIt

Parameters:
b -

setParameterValueFromXML

public void setParameterValueFromXML(org.jdom.Element elm)
                              throws org.jdom.JDOMException,
                                     Parameter.ParameterException,
                                     Parameters.ParametersException,
                                     org.jaxen.JaxenException
Throws:
org.jdom.JDOMException
Parameter.ParameterException
Parameters.ParametersException
org.jaxen.JaxenException

setParameterValues

public void setParameterValues(java.lang.String[] args)
                        throws Parameter.ParameterException,
                               Parameters.ParametersException
Throws:
Parameter.ParameterException
Parameters.ParametersException

setUpParameters

public void setUpParameters()
                     throws org.jdom.JDOMException,
                            Parameter.ParameterException,
                            Parameters.ParametersException
creates CAMparameters based on values from the XML Instance File

Throws:
org.jdom.JDOMException
Parameter.ParameterException
Parameters.ParametersException

setTemplate

public void setTemplate(org.jdom.Document template)
                 throws java.io.IOException,
                        org.jdom.JDOMException,
                        Parameters.ParametersException,
                        org.jaxen.JaxenException,
                        Parameter.ParameterException
Throws:
java.io.IOException
org.jdom.JDOMException
Parameters.ParametersException
org.jaxen.JaxenException
Parameter.ParameterException

getRules

public org.jdom.Element getRules()
                          throws org.jdom.JDOMException,
                                 Parameters.ParametersException,
                                 org.jaxen.JaxenException
Throws:
org.jdom.JDOMException
Parameters.ParametersException
org.jaxen.JaxenException