com.ihr.xbrl.om.formula.filters
Class XBRLOrFilter

java.lang.Object
  extended by com.ihr.xbrl.om.XMLFragment
      extended by com.ihr.xbrl.om.exLinks.XLinkElement
          extended by com.ihr.xbrl.om.exLinks.XBRLPointerOfARelationship
              extended by com.ihr.xbrl.om.exLinks.XBRLResource
                  extended by com.ihr.xbrl.om.formula.XBRLFormulaResource
                      extended by com.ihr.xbrl.om.formula.filters.XBRLOrFilter
All Implemented Interfaces:
XBRLRelationshipPoint, XBRLDelayedCompilationFilter, XBRLFormulaFilter, HasFormulaProcessor, XBRLValidation, XBRLValueKey, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext

public class XBRLOrFilter
extends XBRLFormulaResource
implements XBRLDelayedCompilationFilter

Author:
Ignacio

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation
XBRLValidation.Direction
 
Field Summary
static javax.xml.namespace.QName resourceName
           
 
Fields inherited from class com.ihr.xbrl.om.exLinks.XBRLResource
nullResource
 
Fields inherited from class com.ihr.xbrl.om.exLinks.XLinkElement
actuate, ACTUATE, ARC, arcrole, ARCROLE, ETITLE, EXTENDED, from, FROM, href, HREF, label, LABEL, LOCATOR, RESOURCE, role, ROLE, show, SHOW, SIMPLE, title, TITLE, to, TO, TYPE
 
Fields inherited from class com.ihr.xbrl.om.XMLFragment
CONCEPT_LABEL, CONCEPT_QNAME, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, idQName, NO_POSITION, OrderComparator, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER
 
Constructor Summary
XBRLOrFilter(XBRLFormulaProcessor proc, XBRLResource other)
           
 
Method Summary
 void collectVariables(java.util.Collection<javax.xml.namespace.QName> col, java.util.Collection<net.sf.saxon.s9api.QName> resolved)
          This method is called after the filter has been compiled.
 boolean compileFilter()
          This is the method that will be called by the Formula Processor in order to compile the filter XPath expression.
 int getCorevedAspect()
          Returns a constant value indicating the aspect covered by this filter Constants are defined in the CommonAspectRule class
 int getFilterWeight()
          Returns a number assigned statically to every filter type in order to facilitate evaluate the right order in which filters should be concatenated in an XPath expression or Boolean Filter.
 java.lang.String getXPathTerm(java.util.Collection<net.sf.saxon.s9api.QName> preDefinedVariables)
          Access to the XPath expression for this filter according to the formula specification
 boolean isCompiled()
          There may be nested dependencies between 'and' and 'or' filters.
 
Methods inherited from class com.ihr.xbrl.om.formula.XBRLFormulaResource
getProcessor
 
Methods inherited from class com.ihr.xbrl.om.exLinks.XBRLResource
addChild, clear, equals, generateLocatorToNode, generateNode, getAttributes, getDTSBase, getFriendlyName, getFriendlyName, getParent, getRoleType, getType, getValidationReport, getValueKey, hashCode, invalidate, invalidate, isComplexType, isOnValidation, isSimpleType, setComplexType, setDTSBase, setId, setParent, setRole, setRoleType, setSimpleType, setValue, validate
 
Methods inherited from class com.ihr.xbrl.om.exLinks.XLinkElement
getActuate, getArcrole, getFromTxt, getHRef, getLabel, getRole, getShow, getStaticLabel, getSType, getTitle, getToTxt, isRequiredAttribute, isValidAttribute, setActuate, setArcrole, setFrom, setHRef, setLabel, setShow, setSType, setTitle, setTo
 
Methods inherited from class com.ihr.xbrl.om.XMLFragment
addAttribute, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clone, clone, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAttribute, getAttributeQNameValue, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getId, getLang, getNamespaceURI, getNodeName, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getStringValue, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolveHRef, resolveHRef, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setValue, setVariablesDefined, toString, valueEquals, xEqual
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ihr.xbrl.om.formula.filters.XBRLFormulaFilter
getLabel
 
Methods inherited from interface com.ihr.xbrl.om.exLinks.XBRLRelationshipPoint
addFromRelationship, addToRelationship, getFromRelationships, getToRelationships, removeFromRelationship, removeToRelationship
 

Field Detail

resourceName

public static final javax.xml.namespace.QName resourceName
Constructor Detail

XBRLOrFilter

public XBRLOrFilter(XBRLFormulaProcessor proc,
                    XBRLResource other)
             throws XFValidationException
Parameters:
proc -
other -
Throws:
XFValidationException
Method Detail

compileFilter

public boolean compileFilter()
                      throws XFValidationException
Description copied from interface: XBRLDelayedCompilationFilter
This is the method that will be called by the Formula Processor in order to compile the filter XPath expression.

Specified by:
compileFilter in interface XBRLDelayedCompilationFilter
Returns:
true if the filter has been successfully compiled. False if the filter requires further compilation.
Throws:
XFValidationException

collectVariables

public void collectVariables(java.util.Collection<javax.xml.namespace.QName> col,
                             java.util.Collection<net.sf.saxon.s9api.QName> resolved)
Description copied from interface: XBRLFormulaFilter
This method is called after the filter has been compiled. The method must add to the parameter all variables required for the evaluation of the XPath sentence that will be returned by the getXPathTerm() method

Specified by:
collectVariables in interface XBRLFormulaFilter
Parameters:
col - the collection where variables will be appended

getCorevedAspect

public int getCorevedAspect()
Description copied from interface: XBRLFormulaFilter
Returns a constant value indicating the aspect covered by this filter Constants are defined in the CommonAspectRule class

Specified by:
getCorevedAspect in interface XBRLFormulaFilter
Returns:
integer constant

getXPathTerm

public java.lang.String getXPathTerm(java.util.Collection<net.sf.saxon.s9api.QName> preDefinedVariables)
                              throws XFValidationException
Description copied from interface: XBRLFormulaFilter
Access to the XPath expression for this filter according to the formula specification

Specified by:
getXPathTerm in interface XBRLFormulaFilter
Parameters:
preDefinedVariables - set of pre defined variables in the variable set
Returns:
The XPath expression for this filter
Throws:
XFValidationException - if the variable filter XPath expression cannot be compiled for any reason

getFilterWeight

public int getFilterWeight()
Description copied from interface: XBRLFormulaFilter
Returns a number assigned statically to every filter type in order to facilitate evaluate the right order in which filters should be concatenated in an XPath expression or Boolean Filter. The number is assigned in a table inside the XBRLFilterOrderTool class

Specified by:
getFilterWeight in interface XBRLFormulaFilter
Returns:
integer for comparison of filter order

isCompiled

public boolean isCompiled()
Description copied from interface: XBRLDelayedCompilationFilter
There may be nested dependencies between 'and' and 'or' filters. so resources may not be available in the form of a filter during the filter compilation time.

If this happens (resources not available) then this flag is marked as true (resource not compiled) and the XPath expression is not generated.

During compilation phase of 'and' and 'or' a loop is created until all filters are compiled.

Specified by:
isCompiled in interface XBRLDelayedCompilationFilter
Returns:
true if the filter XPath expression has been generated completely


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa