com.batavia.xml
Interface XmlElement

All Superinterfaces:
java.lang.Comparable, ComparablePart, IdKeeper, org.relaxng.datatype.ValidationContext, XmlParticle
All Known Subinterfaces:
All, Annotation, AnyAttribute, AnyElement, AppInfo, Arc, ArcroleRef, ArcroleType, AttributeGroup, AttributeType, BasicType, CalculationArc, CalculationLink, Choice, ComplexContent, ComplexType, Concept, Context, ContextElement, DateTime, Declaration, DeclaredArc, DeclaredLink, DeclaredResource, Definition, DefinitionArc, DefinitionLink, DimensionalContext, DimensionalFractionItem, DimensionalItem, DimensionalMember, DimensionalScenario, DimensionalSegment, Divide, Documentation, Documentation, EndDate, Entity, ExplicitMember, ExtendedLink, Extension, ExtensionType, Fact, Footnote, FootnoteArc, FootnoteLink, FootnoteLocator, Forever, Fraction, FractionDenominator, FractionItemType, FractionNumerator, FractionPart, Group, GroupRefElement, Identifier, Import, Include, InstanceElement, Instant, Item, Item, Label, LabelArc, Labelled, LabelLink, Linkbase, LinkbaseExtendedLink, LinkbaseRef, LinkbaseRef, LinkbaseRoot, LinkElement, Locator, Measure, MessageElement, MessagesElement, OriginElement, Part, Period, PresentationArc, PresentationLink, Redefine, RefElement, Reference, ReferenceArc, ReferenceLink, RegularInstanceElement, RegularSchemaElement, RelationLink, ReportScope, Resource, Restriction, RestrictionElement, RoleRef, RoleType, RoleTypeElement, Root, RootElement, Scenario, SchemaRef, Segment, Sequence, SimpleContent, SimpleLink, SimpleType, StartDate, TaxonomyElement, Title, Tuple, Tuple, TypedMember, Unit, UnitDenominator, UnitElement, UnitNumerator, UnknownInstanceElement, UnknownTaxonomyElement, UnknownXlink, UsedOn, Xbrl, XbrlElement, XbrlType, Xlink

public interface XmlElement
extends XmlParticle, IdKeeper

Interface for all types of elements in XBRL environment.

This element is a NODE in a DOM.

Copyright 2006 J2R BV, The Netherlands.

Part of Licensed Materials.

www.batavia-xbrl.com

Author:
Ron van Ardenne

Method Summary
 void addAttribute(XmlAttribute prefixNameValue)
          add the attribute with its fully qualified name as key
 void addChild(XmlElement child)
          add the child to the collection of children
 void addChildren(java.util.List potentialNewChildren)
           
 void addComment(Comment comment)
           
 void addMessage(com.j2r.xbrl.validation.MessageElementImpl msg)
           
 void addNameSpace(java.lang.String namePrefix, java.lang.String URI)
          Add the NameSpaceImpl with the given URI to the NameSpaces this XbrlElementImpl knows off under the given namePrefix.
 void clearMessages()
           
 void fromXml(com.batavia.jdom.Element element)
          read the xbrl content of this element from the jdom Element. delagate to the children XbrlElementImpl only has knowledge on its own value member.
 XmlAttribute getAttribute(FullyQualifiedName qName)
          get the attribute with the given FullyQualifiedName if found, else return null
 XmlAttribute getAttribute(FullyQualifiedName qName, java.lang.String defaultValue)
          get the attribute with the given FullyQualifiedName.
 Set getAttributeSet()
           
 XmlElement getChild(FullyQualifiedName qName)
          Get the child with the given FullyQualifiedName
 Sequence getChildren()
          Get children Sequence.
 java.util.List getChildren(FullyQualifiedName qName)
           
 NameSpace getDefaultNameSpace()
          Get the namespace that was added without a prefixName; if not here, check the parent (if not null or equal to this).
 java.lang.String getDocumentHref()
          Each element is contained by a document. the document href indicates the location for that document.
 java.lang.String getErrorMessage()
          Each element can contain a error message that indicates errors thatw ere discovered during xbrl validation
 FullyQualifiedName getFullyQualifiedNameValue()
          If no prefix in the value, then only the name is filled
 java.util.Map getMappedChildren()
           
 java.util.List getMessages()
           
 FullyQualifiedName getName()
          Get the FullyQualifiedName
 NameSpace getNameSpace(java.lang.String namePrefix)
          Get the namespace that is associated with the given prefix; if not here, check the parent (if not null or equal to this).
 java.util.Map getNameSpacePrefixes()
           
 java.util.Map getNameSpaces()
          Get children Sequence.
 XmlElement getPointedElement(java.lang.String xpointer)
          Get the element that is indicated with the given xpointer.
 XmlAttribute getValidXmlBase()
          Get the ValidXmlBase value for this element.
 java.lang.String getValue()
          get the value
 NameSpace getXmlElementNameSpace()
          Get the NameSpace the element is in.
 XmlElement getXmlRoot()
          get the root (farest parent) for this
 boolean isValid()
          returns false only when validated by its parent in a validation call AND when a problem was detected
 void moveChild(XmlElement child)
          Add the child to the collection of children, removing it from it's former parent.
 void removeAttribute(XmlAttribute attribute)
          remove the attribute from the collection of attributes
 void removeChild(XmlElement child)
          remove the child from the collection of children
 java.lang.String resolvePointedValue(java.lang.String xpointerOptionalAttribute)
           
 XmlParticle resolvePointedXmlParticle(java.lang.String xpointerOptionalAttribute)
           
 void setAttributeValue(FullyQualifiedName qName, java.lang.String value)
           
 void setChildren(java.util.List newChildren, FullyQualifiedName qName)
          remove all xmlelements with given qname aand set the children as the collection of children for the XmlElements with given qname.
 void setDocumentHref(java.lang.String href)
           
 void setErrorMessage(java.lang.String errorMessage)
          Each element can contain a error message that indicates errors thatw ere discovered during xbrl validation
 void setInit(boolean init)
           
 void setName(FullyQualifiedName name)
          SetImpl the FullyQualifiedName.
 void setTargetNameSpace(NameSpace targetNameSpace)
          Set the namespace this element and its children contribute to.
 void setValue(java.lang.String value)
          Set the value
 com.batavia.jdom.Element toXml()
           
 void toXml(org.xml.sax.ContentHandler out)
          Write this object's XML contents to the given contenthandler without start or enddocument.
 void toXmlStream(java.io.OutputStream out)
          Write this object's XML contents to the given stream.
 java.lang.String toXmlString()
          Convert this object to a string representation of the XML contents.
 java.lang.StringBuffer toXstringBuffer()
           
 boolean validate(ValidationDocument messagesList)
          Validate this xbrl part (of the instance and/or its supporting discoverable taxonomy set) and add messages on any problem to the given XbrlValidationMessagesImpl collection.
 
Methods inherited from interface com.batavia.xml.XmlParticle
destroy, getBaseUri, getParent, getPrefix, getTargetNameSpace, isBoolean, isNumber, p_equal, resolveNamespacePrefix, setParent, toXstring
 
Methods inherited from interface com.batavia.xml.ComparablePart
c_equal, identical, s_equal, u_equal, v_equal, x_equal
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.relaxng.datatype.ValidationContext
isNotation, isUnparsedEntity
 
Methods inherited from interface com.batavia.xml.IdKeeper
addIdHolder, getHolder, removeIdHolder
 

Method Detail

getErrorMessage

java.lang.String getErrorMessage()
Each element can contain a error message that indicates errors thatw ere discovered during xbrl validation

Returns:
the error message on this element

clearMessages

void clearMessages()

setErrorMessage

void setErrorMessage(java.lang.String errorMessage)
Each element can contain a error message that indicates errors thatw ere discovered during xbrl validation

Parameters:
errorMessage - String the error message on this element

setTargetNameSpace

void setTargetNameSpace(NameSpace targetNameSpace)
Set the namespace this element and its children contribute to.

Parameters:
targetNameSpace - The targetNameSpace to set.

addAttribute

void addAttribute(XmlAttribute prefixNameValue)
add the attribute with its fully qualified name as key

Parameters:
prefixNameValue - XmlAttribute

moveChild

void moveChild(XmlElement child)
Add the child to the collection of children, removing it from it's former parent. Does nothing if the child is already within this parent.

Parameters:
child -

addChild

void addChild(XmlElement child)
add the child to the collection of children

Parameters:
child - XbrlElement

fromXml

void fromXml(com.batavia.jdom.Element element)
read the xbrl content of this element from the jdom Element. delagate to the children XbrlElementImpl only has knowledge on its own value member. All other initialization has to handled by subclasses. Subclasses call their super to init first. The FullyQualifiedNames of XbrlElements are children of the Parent of the XbrlElementImpl


addNameSpace

void addNameSpace(java.lang.String namePrefix,
                  java.lang.String URI)
Add the NameSpaceImpl with the given URI to the NameSpaces this XbrlElementImpl knows off under the given namePrefix.

Parameters:
namePrefix - short id for the namespace in the context of this xbrl element and its children.
URI - unique identification for the namespace

getAttribute

XmlAttribute getAttribute(FullyQualifiedName qName)
get the attribute with the given FullyQualifiedName if found, else return null

Parameters:
qName - FullyQualifiedName
Returns:
the XmlAttribute with the given FullyQualifiedName if found, else return null

getAttribute

XmlAttribute getAttribute(FullyQualifiedName qName,
                          java.lang.String defaultValue)
get the attribute with the given FullyQualifiedName. If not found, make it and add it to this element with the given defaultValue

Parameters:
defaultValue - String
qName - FullyQualifiedName
Returns:
the XmlAttribute with the given FullyQualifiedName or a new one with the given defaultValue.

getAttributeSet

Set getAttributeSet()
Returns:
Returns the attributeSet.

getChild

XmlElement getChild(FullyQualifiedName qName)
Get the child with the given FullyQualifiedName

Parameters:
qName - FullyQualifiedName
Returns:
the child XbrlElement with the given qName or null if not found with that name.

getNameSpaces

java.util.Map getNameSpaces()
Get children Sequence.

Returns:
Returns the children.

getNameSpacePrefixes

java.util.Map getNameSpacePrefixes()

getDefaultNameSpace

NameSpace getDefaultNameSpace()
Get the namespace that was added without a prefixName; if not here, check the parent (if not null or equal to this).

Returns:
Returns the default nameSpace, ONLY when it was already requested once using its URI as second argument.

getDocumentHref

java.lang.String getDocumentHref()
Each element is contained by a document. the document href indicates the location for that document.

Returns:
String the document href

getFullyQualifiedNameValue

FullyQualifiedName getFullyQualifiedNameValue()
If no prefix in the value, then only the name is filled

Returns:
Returns the value in a FullyQualifiedName.

getName

FullyQualifiedName getName()
Get the FullyQualifiedName

Returns:
Returns the name.

getNameSpace

NameSpace getNameSpace(java.lang.String namePrefix)
Get the namespace that is associated with the given prefix; if not here, check the parent (if not null or equal to this). Attributes do not have a default namespace, so when the argument is null or an empty String the return value is null.

Specified by:
getNameSpace in interface XmlParticle
Parameters:
namePrefix - prefix of a name for which the namespace is requested.
Returns:
Returns the namesSpace, returns null if no namespace is associated with the given namePrefix.

getPointedElement

XmlElement getPointedElement(java.lang.String xpointer)
Get the element that is indicated with the given xpointer. To point to a particular XML element, URIs used in [XLINK] hrefs MUST end in a fragment identifier. According to the [XLINK] specification, XPointer [XPTR] syntax is allowed in the fragment identifier. The format of the fragment identifier MUST conform to the requirements set out for shorthand pointers (http://www.w3.org/TR/xptr-framework/#shorthand) or to the requirements set out for a scheme-based pointer (http://www.w3.org/TR/xptr-framework/#scheme). The only scheme allowed for scheme-based pointers in XBRL links is the element scheme [ELEMENT]. Start with this element as root and try to resolve the path indicated by the xpointer.

Specified by:
getPointedElement in interface IdKeeper
Parameters:
xpointer - String with the xpointer value
Returns:
The element that could be identified by the xpointer or null if not found.

getValidXmlBase

XmlAttribute getValidXmlBase()
Get the ValidXmlBase value for this element. If this element does not have a xmlbase attribute, get it from its parent.

Returns:
the xmlbase attribute that was found first while wlking through this element and its ancestors.

getValue

java.lang.String getValue()
get the value

Returns:
String the value.

getXmlElementNameSpace

NameSpace getXmlElementNameSpace()
Get the NameSpace the element is in. This is the NameSpace the name of the element is in.

Returns:
Returns the nameSpace the element is in, ONLY when it was already requested once using its URI as second argument.

removeAttribute

void removeAttribute(XmlAttribute attribute)
remove the attribute from the collection of attributes

Parameters:
attribute - XmlAttribute

removeChild

void removeChild(XmlElement child)
remove the child from the collection of children

Parameters:
child - XbrlElement

setName

void setName(FullyQualifiedName name)
SetImpl the FullyQualifiedName.

Parameters:
name - The name to set.

setValue

void setValue(java.lang.String value)
Set the value

Parameters:
value - String

toXmlString

java.lang.String toXmlString()
                             throws XbrlException
Convert this object to a string representation of the XML contents.

Returns:
String representation XML contents.
Throws:
XbrlException

toXmlStream

void toXmlStream(java.io.OutputStream out)
                 throws XbrlException
Write this object's XML contents to the given stream.

Throws:
XbrlException

toXml

void toXml(org.xml.sax.ContentHandler out)
           throws XbrlException
Write this object's XML contents to the given contenthandler without start or enddocument.

Throws:
XbrlException

validate

boolean validate(ValidationDocument messagesList)
Validate this xbrl part (of the instance and/or its supporting discoverable taxonomy set) and add messages on any problem to the given XbrlValidationMessagesImpl collection.

Parameters:
msgs - The messages that indicate the problems with the instance and or its supporting taxonomy set
Returns:
true if there ar no problems with this XmlElement

getChildren

java.util.List getChildren(FullyQualifiedName qName)

addComment

void addComment(Comment comment)

setAttributeValue

void setAttributeValue(FullyQualifiedName qName,
                       java.lang.String value)

setDocumentHref

void setDocumentHref(java.lang.String href)

resolvePointedValue

java.lang.String resolvePointedValue(java.lang.String xpointerOptionalAttribute)
                                     throws XbrlException
Throws:
XbrlException

resolvePointedXmlParticle

XmlParticle resolvePointedXmlParticle(java.lang.String xpointerOptionalAttribute)
                                      throws XbrlException
Throws:
XbrlException

toXstringBuffer

java.lang.StringBuffer toXstringBuffer()

getXmlRoot

XmlElement getXmlRoot()
get the root (farest parent) for this

Returns:

getMappedChildren

java.util.Map getMappedChildren()
Returns:
Returns the mappedChildren.

isValid

boolean isValid()
returns false only when validated by its parent in a validation call AND when a problem was detected

Returns:
boolean

addMessage

void addMessage(com.j2r.xbrl.validation.MessageElementImpl msg)

getMessages

java.util.List getMessages()

getChildren

Sequence getChildren()
Get children Sequence.

Returns:
Returns the children.

addChildren

void addChildren(java.util.List potentialNewChildren)

setChildren

void setChildren(java.util.List newChildren,
                 FullyQualifiedName qName)
remove all xmlelements with given qname aand set the children as the collection of children for the XmlElements with given qname.

Parameters:
children - List with XmlElement objects

toXml

com.batavia.jdom.Element toXml()

setInit

void setInit(boolean init)