public interface Fragment extends XML
Modifier and Type | Method and Description |
---|---|
void |
appendElementSchemeXPointer(java.lang.String expression)
Add an element Scheme XPointer Expression to the metadata.
|
void |
appendID(java.lang.String id)
Add an ID (used in XPointer resolution) to the metadata.
|
java.util.List<Fragment> |
getAllChildren()
Gets all child fragments.
|
java.util.Set<java.lang.String> |
getAllChildrenIndices() |
Fragment |
getAncestorOrSelf(java.lang.String type)
Gets the ancestor (or self) fragment with the specified fragment type.
|
Fragment |
getChild(java.lang.String type,
int index)
Get a specific child fragment.
|
<F extends Fragment> |
getChildren(java.lang.Class<?> requiredClass)
Gets the child fragments with the specified fragment type.
|
<F extends Fragment> |
getChildren(java.lang.String type)
Gets the child fragments with the specified fragment type.
|
java.util.Set<java.lang.String> |
getChildrenIndices(java.lang.String type) |
org.w3c.dom.Element |
getDataRootElement()
Get the root element of the fragment data.
|
java.lang.String |
getElementSchemeXPointerExpression() |
java.lang.String |
getIDXPointerExpression() |
java.util.List<LabelResource> |
getLabels() |
java.util.List<LabelResource> |
getLabels(java.util.List<java.lang.String> languages,
java.util.List<java.lang.String> labelRoles) |
java.util.List<LabelResource> |
getLabels(java.util.List<java.lang.String> languages,
java.util.List<java.lang.String> labelRoles,
java.util.List<java.lang.String> linkRoles) |
java.util.List<LabelResource> |
getLabelsWithLanguage(java.lang.String language) |
java.util.List<LabelResource> |
getLabelsWithLanguageAndResourceRole(java.lang.String language,
java.lang.String role) |
java.util.List<LabelResource> |
getLabelsWithLanguageAndResourceRoleAndLinkRole(java.lang.String language,
java.lang.String resourceRole,
java.lang.String linkRole) |
java.util.List<LabelResource> |
getLabelsWithResourceRole(java.lang.String resourceRole) |
java.lang.String |
getLanguage() |
java.lang.String |
getLanguage(org.w3c.dom.Node node) |
java.lang.String |
getLanguageName(java.util.List<java.lang.String> languageNameEncodings) |
java.lang.String |
getLanguageName(java.lang.String languageNameEncoding) |
java.lang.String |
getLocalname()
Get the local name of the fragment's root element
|
java.lang.String |
getLocalnameFromQName(java.lang.String qname)
Returns the local name for a QName
|
java.lang.String |
getNamespace()
Get the namespace of the fragment root element.
|
java.lang.String |
getNamespaceFromQName(java.lang.String qname,
org.w3c.dom.Node node)
Returns the Namespace for a QName in the context of a node in the fragment.
|
Fragment |
getParent()
Get the parent fragment of this fragment or null if there is none.
|
org.w3c.dom.Element |
getParentElement(org.w3c.dom.Element parentDataRootElement)
Get the element in the parent fragment that has this fragment as its child.
|
java.lang.String |
getParentIndex()
Get the index of the parent fragment or null if the fragment
does not have a parent fragment.
|
java.lang.String |
getPrefixFromQName(java.lang.String qname)
Returns the Namespace prefix for a QName
|
java.util.List<ReferenceResource> |
getReferences() |
java.util.List<ReferenceResource> |
getReferencesWithLanguage(java.lang.String language) |
java.util.List<ReferenceResource> |
getReferencesWithLanguageAndResourceRoleAndLinkRole(java.lang.String language,
java.net.URI resourceRole,
java.net.URI linkRole) |
java.util.List<ReferenceResource> |
getReferencesWithLanguageAndRole(java.lang.String language,
java.net.URI role) |
java.util.List<ReferenceResource> |
getReferencesWithResourceRole(java.lang.String role) |
java.util.List<Locator> |
getReferencingLocators()
Retrieves a list of all locators that target this fragment.
|
java.lang.String[] |
getSequenceToParentElement()
Get the sequence of steps through the parent fragment DOM to the parent element.
|
java.lang.String |
getSequenceToParentElementAsString() |
java.util.List<SimpleLink> |
getSimpleLinks() |
java.net.URI |
getURI()
Get the URI of the document containing this fragment.
|
java.lang.String |
getXPath()
Get the XPath to the element in the parent fragment that is the
parent element of this fragment's root element.
|
java.lang.String |
getXPointerExpression() |
boolean |
isAncestorOf(Fragment descendant) |
boolean |
isChild() |
boolean |
isNewFragment()
Tests if a fragment is new in the sense that it does not have a root data element.
|
boolean |
isRoot() |
void |
setParentIndex(java.lang.String index)
Set the index of the parent fragment.
|
void |
setSequenceToParentElement(Fragment parent)
Specifies the set of ancestor elements of the element in the parent
fragment that is the insertion point for this fragment's root element.
|
void |
setURI(java.net.URI uri)
Set the URI of the fragment's document.
|
appendMetadataElement, equals, getBuilder, getDocumentNode, getIndex, getMetaAttribute, getMetadataRootElement, getStore, getType, hashCode, hasMetaAttribute, isa, isa, removeMetaAttribute, removeMetadataElement, serialize, serialize, serialize, setBuilder, setIndex, setMetaAttribute, setResource, setStore, updateInStore
org.w3c.dom.Element getDataRootElement() throws XBRLException
XBRLException
- if the fragment does not have fragment data.boolean isNewFragment() throws XBRLException
XBRLException
java.net.URI getURI() throws XBRLException
XBRLException
void setURI(java.net.URI uri) throws XBRLException
uri
- The string value of the document's absolute URIXBRLException.
XBRLException
java.util.List<Locator> getReferencingLocators() throws XBRLException
XBRLException.
XBRLException
java.lang.String getParentIndex() throws XBRLException
XBRLException
- if the parent fragment index is not available.boolean isRoot() throws XBRLException
XBRLException
isChild()
java.lang.String[] getSequenceToParentElement() throws XBRLException
XBRLException
java.lang.String getSequenceToParentElementAsString() throws XBRLException
XBRLException
void setParentIndex(java.lang.String index) throws XBRLException
index
- The index of the parent fragment.XBRLException
- if the parent fragment index cannot be set.java.lang.String getXPath() throws XBRLException
XBRLException
void setSequenceToParentElement(Fragment parent) throws XBRLException
parent
- The parent fragment.XBRLException
void appendID(java.lang.String id) throws XBRLException
id
- The value of the ID.XBRLException.
XBRLException
void appendElementSchemeXPointer(java.lang.String expression) throws XBRLException
expression
- The XPointer expressionXBRLException
java.lang.String getXPointerExpression() throws XBRLException
XBRLException
java.lang.String getElementSchemeXPointerExpression() throws XBRLException
XBRLException
java.lang.String getIDXPointerExpression() throws XBRLException
XBRLException
java.lang.String getNamespace() throws XBRLException
XBRLException
- if there is no data element
in the fragment.java.lang.String getLocalname() throws XBRLException
XBRLException
org.w3c.dom.Element getParentElement(org.w3c.dom.Element parentDataRootElement) throws XBRLException
parentDataRootElement
- The root element of the parent fragment's data.XBRLException
Fragment getParent() throws XBRLException
XBRLException
boolean isChild() throws XBRLException
XBRLException
boolean isAncestorOf(Fragment descendant) throws XBRLException
descendant
- The candidate descendant fragment.XBRLException
java.util.List<Fragment> getAllChildren() throws XBRLException
XBRLException
java.util.Set<java.lang.String> getAllChildrenIndices() throws XBRLException
XBRLException
java.util.List<SimpleLink> getSimpleLinks() throws XBRLException
XBRLException
Fragment getAncestorOrSelf(java.lang.String type) throws XBRLException
type
- The required fragment type of the ancestor (or self).XBRLException
- if no such ancestor fragment exists.java.lang.String getNamespaceFromQName(java.lang.String qname, org.w3c.dom.Node node) throws XBRLException
qname
- The qName value to resolvenode
- The node in the fragment data (as a DOM representation) to start QName resolution from.XBRLException
- if the namespace is not declaredjava.lang.String getLocalnameFromQName(java.lang.String qname)
qname
- The qName value to resolvejava.lang.String getPrefixFromQName(java.lang.String qname)
qname
- The qName value to resolveXBRLException
java.util.List<LabelResource> getLabels() throws XBRLException
XBRLException
java.util.List<LabelResource> getLabelsWithResourceRole(java.lang.String resourceRole) throws XBRLException
resourceRole
- The XLink role valueXBRLException
java.util.List<LabelResource> getLabels(java.util.List<java.lang.String> languages, java.util.List<java.lang.String> labelRoles) throws XBRLException
languages
- the list of language codes in order of preference from most preferred to least
preferred, eventually allowing any language if no explicit preference match.labelRoles
- the list of label resource roles in order of preference from most preferred
to least preferred, eventually allowing any resource role.XBRLException
java.util.List<LabelResource> getLabels(java.util.List<java.lang.String> languages, java.util.List<java.lang.String> labelRoles, java.util.List<java.lang.String> linkRoles) throws XBRLException
languages
- the list of language codes in order of preference from most
preferred to least preferred, eventually allowing any language
if no explicit preference match.labelRoles
- the list of label resource roles in order of preference from
most preferred to least preferred, eventually allowing any
resource role.linkRoles
- the list of extended link roles in order of preference from
most preferred to least preferred, eventually allowing any
link role.XBRLException
java.util.List<ReferenceResource> getReferencesWithResourceRole(java.lang.String role) throws XBRLException
role
- The XLink role valueXBRLException
java.util.List<LabelResource> getLabelsWithLanguage(java.lang.String language) throws XBRLException
language
- The xml:lang language codevalueXBRLException
java.util.List<LabelResource> getLabelsWithLanguageAndResourceRole(java.lang.String language, java.lang.String role) throws XBRLException
language
- The xml:lang language code valuerole
- The XLink role valueXBRLException
java.util.List<LabelResource> getLabelsWithLanguageAndResourceRoleAndLinkRole(java.lang.String language, java.lang.String resourceRole, java.lang.String linkRole) throws XBRLException
language
- The xml:lang language code value or null if not used as
a a label selection criterion.resourceRole
- The XLink resource role value on the label or null if not used as
a a label selection criterion.linkRole
- The XLink extended link role value on the
extended link containing the label or null if not used as
a a label selection criterion..XBRLException
java.util.List<ReferenceResource> getReferences() throws XBRLException
XBRLException
java.util.List<ReferenceResource> getReferencesWithLanguage(java.lang.String language) throws XBRLException
language
- The xml:lang language code valueXBRLException
java.util.List<ReferenceResource> getReferencesWithLanguageAndRole(java.lang.String language, java.net.URI role) throws XBRLException
language
- The xml:lang language code valuerole
- The XLink role valueXBRLException
java.util.List<ReferenceResource> getReferencesWithLanguageAndResourceRoleAndLinkRole(java.lang.String language, java.net.URI resourceRole, java.net.URI linkRole) throws XBRLException
language
- The xml:lang language code valueresourceRole
- The XLink resource role value on the referencelinkRole
- The XLink extended link role value on the
extended link containing the reference.XBRLException
Fragment getChild(java.lang.String type, int index) throws XBRLException
type
- The fragment type of the required childindex
- The index of the required child fragment (among other children of the same type)
with the first child being at index 0.XBRLException
- if the index is out of bounds<F extends Fragment> java.util.List<F> getChildren(java.lang.String type) throws XBRLException
type
- The required fragment type of the child.
EG: If a list of
org.xbrlapi.impl.ReferenceArcImpl fragments is required then
this parameter would have a value of "ReferenceArc".
Note that if the parameter contains full stops, then it is used directly
as the value for the fragment type, enabling fragment extensions to exploit this
method without placing fragment implementations in the org.xbrlapi package.XBRLException
<F extends Fragment> java.util.List<F> getChildren(java.lang.Class<?> requiredClass) throws XBRLException
requiredClass
- The required fragment class of the child fragments.XBRLException
java.util.Set<java.lang.String> getChildrenIndices(java.lang.String type) throws XBRLException
type
- The fragment typeXBRLException
java.lang.String getLanguage(org.w3c.dom.Node node) throws XBRLException
node
- The XML node to get the XML language fragment for.XBRLException
java.lang.String getLanguage() throws XBRLException
XBRLException
java.lang.String getLanguageName(java.lang.String languageNameEncoding) throws XBRLException
languageNameEncoding
- The language encoding of the language name, available
in the data store in the form of a Language XML resource.XBRLException
for details of these objects.
java.lang.String getLanguageName(java.util.List<java.lang.String> languageNameEncodings) throws XBRLException
XBRLException