com.ihr.xbrl.om.taxonomy
Class XMLElementDefinition

java.lang.Object
  extended by com.ihr.xbrl.om.XMLFragment
      extended by com.ihr.xbrl.om.taxonomy.XMLElementDefinition
All Implemented Interfaces:
XBRLRelationshipPoint, XBRLValueKey, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
Direct Known Subclasses:
XBRLItem, XBRLTuple

public class XMLElementDefinition
extends XMLFragment
implements XBRLRelationshipPoint, XBRLValueKey

Common elements to both Tuples and Items

Author:
Ignacio

Field Summary
static javax.xml.namespace.QName abstract_
          The [Abstract] property
static int ALL
           
static javax.xml.namespace.QName block
          The [Block] property
static int EMPTY
           
static int EXTENSION
           
static javax.xml.namespace.QName final_
          The [Final] property
static javax.xml.namespace.QName fixed
          The [Fixed] property
static javax.xml.namespace.QName name
          The [Name] property
static javax.xml.namespace.QName nillable
          The [Nillable] property
static XMLElementDefinition nullConcept
           
static int RESTRICTION
           
static int SUBSTITUTION
           
static javax.xml.namespace.QName substitutionGroup
          The [Substitution Group] property
static javax.xml.namespace.QName type
          The [Type] property. can be null if this element is in the substitution group of another element that has a type
static int UNDEFINED
          A locator element pointing to this concept
 
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
XMLElementDefinition(XBRLTaxonomy parent, java.lang.String name, XBRLXSDTypeDefinition type, javax.xml.namespace.QName substitutionGroup, java.lang.Boolean _abstract, java.lang.Boolean nillable, int block, int _final, java.lang.String fixed)
          Constructor to programatically create an element definition
XMLElementDefinition(XBRLTaxonomy parent, net.sf.saxon.s9api.XdmNode node)
          Constructor used when the concept comes from a NodeInfo
XMLElementDefinition(XMLElementDefinition other)
          Copy constructor
 
Method Summary
 void clear()
          Frees-up used memory This method should not be invoqued on live objects in the DTS.
 boolean equals(java.lang.Object other)
          Sets a new XPathFunctionResolver for this object
 XBRLLocator generateLocatorToNode(boolean relativize, java.net.URI base)
           
 org.jdom.Element generateNode(boolean relativize, java.net.URI base)
          Serializes to a jdom Element the representation of the properties of this Information Item This method should be called from classes derived from this class
 boolean getAbstract()
          Deprecated. 
 java.util.Iterator<XBRLAttribute> getAttributes()
          Access to the [Attributes] property
 int getBlock()
          Access to the [Block] property
static java.lang.String getBlock(int block)
          Returns a string representation of the value of the block attribute suitable to be used as the value of the block attribute in an element definition in a schema.
static int getBlock(java.lang.String str)
          Converts the string representation of Block to a integer codification
 java.util.Iterator<XMLFragment> getChildren()
          Access to the [children] property
 int getFinal()
          Access to the [Final] property
static java.lang.String getFinal(int _final)
          Returns a string representation of the value of the block attribute suitable to be used as the value of the block attribute in an element definition in a schema.
static int getFinal(java.lang.String str)
          Converts the string representation of the final token into a code.
 java.lang.String getFixed()
          Access to the [Fixed] property
 java.lang.String getFriendlyName()
          Returns a string description that represents the element content in a form that users can understand.
 java.lang.String getFriendlyName(int modifiers, LabelsProvider lp)
          Returns a string description that represents the element content in a form that users can understand.
 java.util.Collection<? extends XMLElementDefinition> getInSubstitutionGroup()
          Returns a collection of elements that are in the substitution group of this element or has this element in the substitution group hierarchy
 java.lang.String getName()
          Access to the [Name] property
 boolean getNillable()
          Return the value of the [nillable] property
 XBRLTaxonomy getParent()
          Access to the [Parent] property
 javax.xml.namespace.QName getQName()
          Access to the QName property (Not in the infoset) The QName property is a QName with taxonomy targetNamespace and local name equal to the element declaration name There is no setQName method in this object.
 com.saxonica.validate.SimpleContentValidator getSimpleContentValidator()
          Returns a SimpleContentValidator instance that is able to validate the element content.
 javax.xml.namespace.QName getSubstitutionGroup()
          Acces to the [Substitution Group] property
 java.util.Collection<XMLElementDefinition> getSubstitutionGroupHierarchy()
          Returns a collection of XMLElementDefinition elements representing the substitution group hierarchy tree for this concept definition.
 XBRLXSDTypeDefinition getType()
          Access to the [Type] property Returns null if the element has no type definition or if the type is locally defined The returned object is a wrapper of the XSD type definition
 net.sf.saxon.value.QNameValue getValueKey()
           
 int hashCode()
           
 boolean isAbstract()
          Return the value of the [Abstract] property
 boolean isInSubstitutionGroup(XMLElementDefinition element)
          Returns true if the element received as a parameter is in this element's substitution group.
 java.lang.Boolean setAbstract(java.lang.Boolean abstract_)
          Sets the value of the [Abstract] property.
 java.lang.Integer setBlock(java.lang.Integer newValue)
          Sets the value of the [Block] property or resets it if newValue is null
 java.lang.Integer setFinal(java.lang.Integer newValue)
          Set the value of the [Final] property or resets it if newValue is null
 java.lang.String setFixed(java.lang.String value)
          Sets the value of the [Fixed] property
 void setId(java.lang.String id)
          Sets the ID for the concept definition.
 java.lang.String setName(java.lang.String newName)
          Sets the [Name] property to the value indicated.
 java.lang.Boolean setNillable(java.lang.Boolean nillable)
          Sets the value of the [Nillable] property.
 void setParent(XBRLTaxonomy newParent)
          Sets the [Parent] property of this concept
 javax.xml.namespace.QName setSubstitutionGroup(javax.xml.namespace.QName substitutionGroup)
          Sets or reset the value of the [substitutionGroup] property
 XBRLXSDTypeDefinition setType(XBRLXSDTypeDefinition type)
          Sets the item type to the type specified in the XBRLXSDTypeDefinition object or unset the type definition if the attribute value is null
 
Methods inherited from class com.ihr.xbrl.om.XMLFragment
addAttribute, addChild, 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, 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.exLinks.XBRLRelationshipPoint
addFromRelationship, addToRelationship, getFromRelationships, getToRelationships, removeFromRelationship, removeToRelationship
 

Field Detail

name

public static final javax.xml.namespace.QName name
The [Name] property


type

public static final javax.xml.namespace.QName type
The [Type] property. can be null if this element is in the substitution group of another element that has a type


substitutionGroup

public static final javax.xml.namespace.QName substitutionGroup
The [Substitution Group] property


nillable

public static final javax.xml.namespace.QName nillable
The [Nillable] property


abstract_

public static final javax.xml.namespace.QName abstract_
The [Abstract] property


UNDEFINED

public static final int UNDEFINED
A locator element pointing to this concept

See Also:
Constant Field Values

EMPTY

public static final int EMPTY
See Also:
Constant Field Values

ALL

public static final int ALL
See Also:
Constant Field Values

EXTENSION

public static final int EXTENSION
See Also:
Constant Field Values

RESTRICTION

public static final int RESTRICTION
See Also:
Constant Field Values

SUBSTITUTION

public static final int SUBSTITUTION
See Also:
Constant Field Values

block

public static final javax.xml.namespace.QName block
The [Block] property


fixed

public static final javax.xml.namespace.QName fixed
The [Fixed] property


final_

public static final javax.xml.namespace.QName final_
The [Final] property


nullConcept

public static final XMLElementDefinition nullConcept
Constructor Detail

XMLElementDefinition

public XMLElementDefinition(XBRLTaxonomy parent,
                            net.sf.saxon.s9api.XdmNode node)
Constructor used when the concept comes from a NodeInfo

Parameters:
parent - Parent taxonomy
node - the node info with the element definition
Throws:
XBRLValidationException

XMLElementDefinition

public XMLElementDefinition(XBRLTaxonomy parent,
                            java.lang.String name,
                            XBRLXSDTypeDefinition type,
                            javax.xml.namespace.QName substitutionGroup,
                            java.lang.Boolean _abstract,
                            java.lang.Boolean nillable,
                            int block,
                            int _final,
                            java.lang.String fixed)
Constructor to programatically create an element definition

Parameters:
parent - the parent taxonomy (schema)
name - String the new element name, cannot be null
type - XBRLXSDTypeDefinition the type definition for this new element, may be null
substitutionGroup - QName the substitution group, may also be null
_abstract - Boolean true if the element definition is abstract
nillable - Boolean true if the xsi:nill is permitted null here means nillable is false.
block - int indicating the block value (see XSD Infoset) {UNDEFINED | EMPTY | ALL | EXTENSION | RESTRICTION | SUBSTITUTION}
_final - int indicating final for (see XSD Infoset) {UNDEFINED | EMPTY | ALL | EXTENSION | RESTRICTION | SUBSTITUTION}
fixed - String fixed value, can be null
Throws:
XBRLValidationException

XMLElementDefinition

public XMLElementDefinition(XMLElementDefinition other)
Copy constructor

Parameters:
other -
Method Detail

setType

public XBRLXSDTypeDefinition setType(XBRLXSDTypeDefinition type)
Sets the item type to the type specified in the XBRLXSDTypeDefinition object or unset the type definition if the attribute value is null

Parameters:
type - new XBRLXSDTypeDefinition or null
Returns:
old type definition XBRLXSDTypeDefinition
Since:
2.6.5

clear

public void clear()
           throws java.lang.Throwable
Description copied from class: XMLFragment
Frees-up used memory

This method should not be invoqued on live objects in the DTS. It is automatically invoqued by the API when an object is no longer used and referenced by other objects. It is save not to call it directly.

Overrides:
clear in class XMLFragment
Throws:
java.lang.Throwable

getQName

public javax.xml.namespace.QName getQName()
Access to the QName property (Not in the infoset)

The QName property is a QName with taxonomy targetNamespace and local name equal to the element declaration name

There is no setQName method in this object. Use setName and/or setParent instead

Returns:
QName

getParent

public XBRLTaxonomy getParent()
Access to the [Parent] property

Specified by:
getParent in interface XMLHasParent
Overrides:
getParent in class XMLFragment
Returns:
the XBRLTaxonomy where the element is defined

setParent

public void setParent(XBRLTaxonomy newParent)
Sets the [Parent] property of this concept


getName

public java.lang.String getName()
Access to the [Name] property

Returns:
String

setName

public java.lang.String setName(java.lang.String newName)
Sets the [Name] property to the value indicated.

Parameters:
newName - as string or null to reset the name
Returns:
the old value of the name attribute
Since:
2.6.5

getType

public XBRLXSDTypeDefinition getType()
Access to the [Type] property Returns null if the element has no type definition or if the type is locally defined The returned object is a wrapper of the XSD type definition

Returns:
XBRLXSDTypeDefinition

getSimpleContentValidator

public com.saxonica.validate.SimpleContentValidator getSimpleContentValidator()
Returns a SimpleContentValidator instance that is able to validate the element content.

Returns:
SimpleContentValidator
Since:
2.6.7

setId

public void setId(java.lang.String id)
           throws XBRLInconsistentDTSException
Sets the ID for the concept definition. Updates the taxonomy accordingly

Overrides:
setId in class XMLFragment
Parameters:
id - the new ID
Throws:
XBRLValidationException - if the id is used by another item definition in the DTS
XBRLInconsistentDTSException - if the id is not lexicographically valid

getSubstitutionGroup

public javax.xml.namespace.QName getSubstitutionGroup()
Acces to the [Substitution Group] property

Returns:
QName

setSubstitutionGroup

public javax.xml.namespace.QName setSubstitutionGroup(javax.xml.namespace.QName substitutionGroup)
Sets or reset the value of the [substitutionGroup] property

Parameters:
substitutionGroup - QName to set, null to reset
Returns:
the previous value of the [substitutionGroup] property
Since:
2.6.5

getNillable

public boolean getNillable()
Return the value of the [nillable] property

Returns:
boolean

setNillable

public java.lang.Boolean setNillable(java.lang.Boolean nillable)
Sets the value of the [Nillable] property. Use null to reset the value

Parameters:
nillable -
Returns:
old value
Since:
2.6.5

getAbstract

@Deprecated
public boolean getAbstract()
Deprecated. 

Return the value of the [Abstract] property.

Deprecated. Use isAbstract() instead.

Returns:
boolean

isAbstract

public boolean isAbstract()
Return the value of the [Abstract] property

Returns:
boolean

setAbstract

public java.lang.Boolean setAbstract(java.lang.Boolean abstract_)
Sets the value of the [Abstract] property. Use null to reset the value

Parameters:
abstract_ -
Returns:
old value
Since:
2.6.5

getFixed

public java.lang.String getFixed()
Access to the [Fixed] property

Returns:
String

setFixed

public java.lang.String setFixed(java.lang.String value)
Sets the value of the [Fixed] property

Parameters:
value - new value or null to reset
Returns:
old value
Since:
2.6.5

getFinal

public int getFinal()
Access to the [Final] property

Returns:
int

setFinal

public java.lang.Integer setFinal(java.lang.Integer newValue)
Set the value of the [Final] property or resets it if newValue is null

Parameters:
newValue - the new value of the final attribute. See constants defined in this object
Returns:
Integer constant with old value or null if previous value was not set
Since:
2.6.5

getFinal

public static int getFinal(java.lang.String str)
Converts the string representation of the final token into a code. If the string does not corresponds to "#all" "extension" or "restriction" the method returns EMPTY

Parameters:
str -
Returns:
Integer

getFinal

public static java.lang.String getFinal(int _final)
Returns a string representation of the value of the block attribute suitable to be used as the value of the block attribute in an element definition in a schema. If the value is not defined thorws an XBRLRuntimeException If the value is UNDEFINED | EMPTY the function returns null

Parameters:
_final - int
Returns:
String

getBlock

public int getBlock()
Access to the [Block] property

Returns:
int

setBlock

public java.lang.Integer setBlock(java.lang.Integer newValue)
Sets the value of the [Block] property or resets it if newValue is null

Parameters:
newValue - Integer constant or null to reset
Returns:
oldValue or null if previous value was not set
Since:
2.6.5

getBlock

public static int getBlock(java.lang.String str)
Converts the string representation of Block to a integer codification

Parameters:
str - any of "#all" "extension" "restriction" "substitution"
Returns:
the code corresponding to the string, if the string is none of those this method returns the code for EMPTY

getBlock

public static java.lang.String getBlock(int block)
Returns a string representation of the value of the block attribute suitable to be used as the value of the block attribute in an element definition in a schema. If the value is not defined thorws an XBRLRuntimeException If the value is UNDEFINED | EMPTY the function returns null

Parameters:
block - integer
Returns:
String

getAttributes

public java.util.Iterator<XBRLAttribute> getAttributes()
Access to the [Attributes] property

Overrides:
getAttributes in class XMLFragment
Returns:
Iterator

getChildren

public java.util.Iterator<XMLFragment> getChildren()
Access to the [children] property

Returns:
Iterator

generateNode

public org.jdom.Element generateNode(boolean relativize,
                                     java.net.URI base)
                              throws XBRLSerializationException
Description copied from class: XMLFragment
Serializes to a jdom Element the representation of the properties of this Information Item This method should be called from classes derived from this class

Overrides:
generateNode in class XMLFragment
Parameters:
relativize - boolean indicating if URIs should be relativized to the base URI (see next argument)
base - the URI to which some attributes of this object should be relativided
Returns:
a clone of the surrounding jdom Element so it can be incorporated into multiple trees
Throws:
XBRLSerializationException

generateLocatorToNode

public XBRLLocator generateLocatorToNode(boolean relativize,
                                         java.net.URI base)
                                  throws java.net.URISyntaxException
Parameters:
base -
relativize -
Returns:
XBRLLocator
Throws:
java.net.URISyntaxException

hashCode

public int hashCode()
Overrides:
hashCode in class XMLFragment

equals

public boolean equals(java.lang.Object other)
Description copied from class: XMLFragment
Sets a new XPathFunctionResolver for this object

Overrides:
equals in class XMLFragment

getValueKey

public net.sf.saxon.value.QNameValue getValueKey()
Specified by:
getValueKey in interface XBRLValueKey

getInSubstitutionGroup

public java.util.Collection<? extends XMLElementDefinition> getInSubstitutionGroup()
Returns a collection of elements that are in the substitution group of this element or has this element in the substitution group hierarchy

Returns:
Collection<? extends XMLElementDefinition>

getSubstitutionGroupHierarchy

public java.util.Collection<XMLElementDefinition> getSubstitutionGroupHierarchy()
Returns a collection of XMLElementDefinition elements representing the substitution group hierarchy tree for this concept definition.

Returns:
Collection<XMLElementDefinition>
Since:
2.7

isInSubstitutionGroup

public boolean isInSubstitutionGroup(XMLElementDefinition element)

Returns true if the element received as a parameter is in this element's substitution group. This means, the parameter element can substitute this element

Parameters:
element -
Returns:
boolean

getFriendlyName

public java.lang.String getFriendlyName()
Description copied from class: XMLFragment
Returns a string description that represents the element content in a form that users can understand. This method may be overridden by parent classes.

Remarks, this method may return very long names not suitable for user interface

Overrides:
getFriendlyName in class XMLFragment
Returns:
Non empty String. Internationalization is enabled

getFriendlyName

public java.lang.String getFriendlyName(int modifiers,
                                        LabelsProvider lp)
Description copied from class: XMLFragment
Returns a string description that represents the element content in a form that users can understand. This method may be override by parent classes.

This function accepts flags that are defined as constants in XMLFragment in order to modify the output.

Overrides:
getFriendlyName in class XMLFragment
Parameters:
modifiers - integer
Returns:
Non empty String. Internationalization is enabled


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