Package ro.sync.ecss.extensions.api.node
Interface AuthorElement
-
- All Superinterfaces:
AuthorElementBaseInterface
,AuthorNode
,AuthorParentNode
@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface AuthorElement extends AuthorElementBaseInterface
The Author Element represents an XML element.
The author content contains the entire XML document text and special marker characters. Each author node points in the content to the start and end marker characters which are used to delimit it's range. The start and end offsets pointed to by the AuthorNode can be retrieved using the AuthorNode.getStartOffset() and AuthorNode.getEndOffset()
The image represents part of the document content and red markers represent special control characters which represent the node ranges.
-
-
Field Summary
-
Fields inherited from interface ro.sync.ecss.extensions.api.node.AuthorNode
NODE_NAME_CDATA, NODE_NAME_COMMENT, NODE_NAME_DOCUMENT, NODE_NAME_PI, NODE_NAME_REFERENCE, NODE_TYPE_CDATA, NODE_TYPE_COMMENT, NODE_TYPE_DOCUMENT, NODE_TYPE_ELEMENT, NODE_TYPE_PI, NODE_TYPE_PSEUDO_DOCTYPE, NODE_TYPE_PSEUDO_ELEMENT, NODE_TYPE_REFERENCE, NODE_TYPE_TEXT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description AttrValue
getAttribute(java.lang.String name)
Returns the value of an attribute with the given name.java.lang.String
getAttributeAtIndex(int index)
Returns the name of the attribute at the specified index.java.lang.String
getAttributeNamespace(java.lang.String attributePrefix)
Get an attribute's namespace.int
getAttributesCount()
Returns the number of the element attributes.AuthorNode
getChild(java.lang.String childLocalName)
Deprecated.UsegetElementsByLocalName(String)
[0] instead.AuthorElement[]
getElementsByLocalName(java.lang.String localName)
Gets the children elements having the specified local name.java.lang.String
getLocalName()
Returns the local part of the qualified name of this element.java.lang.String
getNamespace()
java.util.Set<java.lang.String>
getPseudoClassNames()
Get the names of the pseudo-classes set on this element.void
removeAttribute(java.lang.String qName)
Removes the given attribute from the element list of attributes.
Warning: Use this only when the element is from anAuthorDocumentFragment
and not from the currentAuthorDocument
content.
All operations on nodes from the document model must be done using theAuthorDocumentController
methods.void
setAttribute(java.lang.String qName, AttrValue attributeValue)
Sets the value of an attribute for this element.
Warning: Use this only when the element is from anAuthorDocumentFragment
and not from the currentAuthorDocument
content.
All operations on nodes from the document model must be done using theAuthorDocumentController
methods.void
setAttributesNoNSUpdate(java.util.Map<java.lang.String,AttrValue> attrs)
Sets an attribute, but without performing the update of the namespace mappings updates.void
setName(java.lang.String newName)
Sets the qualified name of this element.
Warning: Use this only when the element is from anAuthorDocumentFragment
and not from the currentAuthorDocument
content.
All operations on nodes from the document model must be done using theAuthorDocumentController
methods.-
Methods inherited from interface ro.sync.ecss.extensions.api.AuthorElementBaseInterface
getBeforeElement, hasPseudoClass, isEmptyCSS3, isFirstChildElement, removePseudoClass, setPseudoClass
-
Methods inherited from interface ro.sync.ecss.extensions.api.node.AuthorNode
getContentIterator, getDisplayName, getEndOffset, getName, getNamespaceContext, getOwnerDocument, getParent, getStartOffset, getTextContent, getType, getXMLBaseURL, isDescendentOf
-
Methods inherited from interface ro.sync.ecss.extensions.api.node.AuthorParentNode
getContentNodes, getParentElement
-
-
-
-
Method Detail
-
getAttribute
AttrValue getAttribute(java.lang.String name)
Returns the value of an attribute with the given name. If no such attribute exists, returnsnull
.- Parameters:
name
- Name of the attribute.- Returns:
- The
AttrValue
, ornull
if the attribute does not exist.
-
getNamespace
java.lang.String getNamespace()
- Specified by:
getNamespace
in interfaceAuthorNode
- Returns:
- The namespace of this element. Empty string is returned if element has no namespace.
-
getLocalName
java.lang.String getLocalName()
Returns the local part of the qualified name of this element.- Specified by:
getLocalName
in interfaceAuthorElementBaseInterface
- Returns:
- The local name of the element.
-
getChild
@Deprecated AuthorNode getChild(java.lang.String childLocalName)
Deprecated.UsegetElementsByLocalName(String)
[0] instead.Search into the list of the children the first node that has specified local name.- Parameters:
childLocalName
- The local name of the searched children.- Returns:
- The searched node or
null
if not found.
-
getElementsByLocalName
AuthorElement[] getElementsByLocalName(java.lang.String localName)
Gets the children elements having the specified local name.- Parameters:
localName
- The local name of the searched children.- Returns:
- The list of children (
AuthorElement
s) having the specified local name or an empty array if none found. if not found.
-
getAttributesCount
int getAttributesCount()
Returns the number of the element attributes.- Returns:
- The number of the element attributes..
-
getAttributeAtIndex
java.lang.String getAttributeAtIndex(int index) throws java.lang.ArrayIndexOutOfBoundsException
Returns the name of the attribute at the specified index.- Parameters:
index
- The index of the searched attribute, 0 based.- Returns:
- The name of the attribute at the specified index,
or
null
if the attribute was not set correctly. - Throws:
java.lang.ArrayIndexOutOfBoundsException
- if the specified index is not in range.
-
setAttribute
void setAttribute(java.lang.String qName, AttrValue attributeValue)
Sets the value of an attribute for this element.
Warning: Use this only when the element is from anAuthorDocumentFragment
and not from the currentAuthorDocument
content.
All operations on nodes from the document model must be done using theAuthorDocumentController
methods. If the element is part of the edited document, an java.lang.UnsupportedOperationException is thrown.- Parameters:
qName
- The qualified name of the attribute to be set.attributeValue
- TheAttrValue
to set. Must not benull
.
-
setName
void setName(java.lang.String newName) throws java.lang.IllegalArgumentException
Sets the qualified name of this element.
Warning: Use this only when the element is from anAuthorDocumentFragment
and not from the currentAuthorDocument
content.
All operations on nodes from the document model must be done using theAuthorDocumentController
methods. If the element is part of the edited document, an java.lang.UnsupportedOperationException is thrown.- Parameters:
newName
- The new qualified name to be set.- Throws:
java.lang.IllegalArgumentException
- When the given name is not a valid qualified name.- Since:
- 16
-
removeAttribute
void removeAttribute(java.lang.String qName)
Removes the given attribute from the element list of attributes.
Warning: Use this only when the element is from anAuthorDocumentFragment
and not from the currentAuthorDocument
content.
All operations on nodes from the document model must be done using theAuthorDocumentController
methods. If the element is part of the edited document, an java.lang.UnsupportedOperationException is thrown.- Parameters:
qName
- The qualified name of the attribute to remove.
-
getAttributeNamespace
java.lang.String getAttributeNamespace(java.lang.String attributePrefix)
Get an attribute's namespace.- Parameters:
attributePrefix
- Prefix of attribute.- Returns:
- The attribute's namespace.
- Since:
- 13.2
-
setAttributesNoNSUpdate
void setAttributesNoNSUpdate(java.util.Map<java.lang.String,AttrValue> attrs)
Sets an attribute, but without performing the update of the namespace mappings updates.
Warning: Use this only when the element is from anAuthorDocumentFragment
and not from the currentAuthorDocument
content.
All operations on nodes from the document model must be done using theAuthorDocumentController
methods. If the element is part of the edited document, an java.lang.UnsupportedOperationException is thrown.- Parameters:
attrs
- The map containing attribute qNames and their attributeValues.
-
getPseudoClassNames
java.util.Set<java.lang.String> getPseudoClassNames()
Get the names of the pseudo-classes set on this element.- Returns:
- a set of pseudo-classes or an empty set. Never
null
. - Since:
- 22.1
-
-