Package io.lighty.codecs.xml
Class XmlElement
- java.lang.Object
-
- io.lighty.codecs.xml.XmlElement
-
@Deprecated(forRemoval=true) public final class XmlElement extends Object
Deprecated, for removal: This API element is subject to removal in a future version.Replaced by OpenDayLight implementationXmlElement
.XmlElement.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_NAMESPACE_PREFIX
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
appendChild(Element child)
Deprecated, for removal: This API element is subject to removal in a future version.void
checkName(String expectedName)
Deprecated, for removal: This API element is subject to removal in a future version.void
checkNamespace(String expectedNamespace)
Deprecated, for removal: This API element is subject to removal in a future version.void
checkNamespaceAttribute(String expectedNamespace)
Deprecated, for removal: This API element is subject to removal in a future version.void
checkUnrecognisedElements(XmlElement... additionalRecognisedElements)
Deprecated, for removal: This API element is subject to removal in a future version.void
checkUnrecognisedElements(List<XmlElement> recognisedElements, XmlElement... additionalRecognisedElements)
Deprecated, for removal: This API element is subject to removal in a future version.boolean
equals(Object obj)
Deprecated, for removal: This API element is subject to removal in a future version.Map.Entry<String,String>
findNamespaceOfTextContent()
Deprecated, for removal: This API element is subject to removal in a future version.Search for element's attributes defining namespaces.static XmlElement
fromDomDocument(Document xml)
Deprecated, for removal: This API element is subject to removal in a future version.static XmlElement
fromDomElement(Element element)
Deprecated, for removal: This API element is subject to removal in a future version.static XmlElement
fromDomElementWithExpected(Element element, String expectedName)
Deprecated, for removal: This API element is subject to removal in a future version.static XmlElement
fromDomElementWithExpected(Element element, String expectedName, String expectedNamespace)
Deprecated, for removal: This API element is subject to removal in a future version.static XmlElement
fromString(String str)
Deprecated, for removal: This API element is subject to removal in a future version.String
getAttribute(String attributeName)
Deprecated, for removal: This API element is subject to removal in a future version.String
getAttribute(String attributeName, String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.Map<String,Attr>
getAttributes()
Deprecated, for removal: This API element is subject to removal in a future version.List<XmlElement>
getChildElements()
Deprecated, for removal: This API element is subject to removal in a future version.List<XmlElement>
getChildElements(String tagName)
Deprecated, for removal: This API element is subject to removal in a future version.Return all XML elements with specified tag name.List<XmlElement>
getChildElementsWithinNamespace(String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.List<XmlElement>
getChildElementsWithinNamespace(String childName, String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.List<XmlElement>
getChildElementsWithSameNamespace(String childName)
Deprecated, for removal: This API element is subject to removal in a future version.Element
getDomElement()
Deprecated, for removal: This API element is subject to removal in a future version.NodeList
getElementsByTagName(String name)
Deprecated, for removal: This API element is subject to removal in a future version.String
getName()
Deprecated, for removal: This API element is subject to removal in a future version.String
getNamespace()
Deprecated, for removal: This API element is subject to removal in a future version.String
getNamespaceAttribute()
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<String>
getNamespaceAttributeOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<String>
getNamespaceOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.XmlElement
getOnlyChildElement()
Deprecated, for removal: This API element is subject to removal in a future version.XmlElement
getOnlyChildElement(String childName)
Deprecated, for removal: This API element is subject to removal in a future version.XmlElement
getOnlyChildElement(String childName, String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<XmlElement>
getOnlyChildElementOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<XmlElement>
getOnlyChildElementOptionally(String childName)
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<XmlElement>
getOnlyChildElementOptionally(String childName, String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.XmlElement
getOnlyChildElementWithSameNamespace()
Deprecated, for removal: This API element is subject to removal in a future version.XmlElement
getOnlyChildElementWithSameNamespace(String childName)
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<XmlElement>
getOnlyChildElementWithSameNamespaceOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<XmlElement>
getOnlyChildElementWithSameNamespaceOptionally(String childName)
Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.base.Optional<String>
getOnlyTextContentOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.String
getTextContent()
Deprecated, for removal: This API element is subject to removal in a future version.int
hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
hasNamespace()
Deprecated, for removal: This API element is subject to removal in a future version.String
toString()
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Field Detail
-
DEFAULT_NAMESPACE_PREFIX
public static final String DEFAULT_NAMESPACE_PREFIX
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
-
Method Detail
-
fromDomElement
public static XmlElement fromDomElement(Element element)
Deprecated, for removal: This API element is subject to removal in a future version.
-
fromDomDocument
public static XmlElement fromDomDocument(Document xml)
Deprecated, for removal: This API element is subject to removal in a future version.
-
fromString
public static XmlElement fromString(String str) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
fromDomElementWithExpected
public static XmlElement fromDomElementWithExpected(Element element, String expectedName) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
fromDomElementWithExpected
public static XmlElement fromDomElementWithExpected(Element element, String expectedName, String expectedNamespace) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
checkName
public void checkName(String expectedName) throws UnexpectedElementException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
UnexpectedElementException
-
checkNamespaceAttribute
public void checkNamespaceAttribute(String expectedNamespace) throws UnexpectedNamespaceException, MissingNameSpaceException
Deprecated, for removal: This API element is subject to removal in a future version.
-
checkNamespace
public void checkNamespace(String expectedNamespace) throws UnexpectedNamespaceException, MissingNameSpaceException
Deprecated, for removal: This API element is subject to removal in a future version.
-
getName
public String getName()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getAttribute
public String getAttribute(String attributeName)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getAttribute
public String getAttribute(String attributeName, String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getElementsByTagName
public NodeList getElementsByTagName(String name)
Deprecated, for removal: This API element is subject to removal in a future version.
-
appendChild
public void appendChild(Element child)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getDomElement
public Element getDomElement()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getAttributes
public Map<String,Attr> getAttributes()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getChildElements
public List<XmlElement> getChildElements()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getChildElements
public List<XmlElement> getChildElements(String tagName)
Deprecated, for removal: This API element is subject to removal in a future version.Return all XML elements with specified tag name.- Parameters:
tagName
- tag name without prefix- Returns:
- List of child elements
-
getChildElementsWithinNamespace
public List<XmlElement> getChildElementsWithinNamespace(String childName, String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getChildElementsWithinNamespace
public List<XmlElement> getChildElementsWithinNamespace(String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getOnlyChildElementOptionally
public com.google.common.base.Optional<XmlElement> getOnlyChildElementOptionally(String childName)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getOnlyChildElementOptionally
public com.google.common.base.Optional<XmlElement> getOnlyChildElementOptionally(String childName, String namespace)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getOnlyChildElementOptionally
public com.google.common.base.Optional<XmlElement> getOnlyChildElementOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getOnlyChildElementWithSameNamespace
public XmlElement getOnlyChildElementWithSameNamespace(String childName) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
getOnlyChildElementWithSameNamespace
public XmlElement getOnlyChildElementWithSameNamespace() throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
getOnlyChildElementWithSameNamespaceOptionally
public com.google.common.base.Optional<XmlElement> getOnlyChildElementWithSameNamespaceOptionally(String childName)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getOnlyChildElementWithSameNamespaceOptionally
public com.google.common.base.Optional<XmlElement> getOnlyChildElementWithSameNamespaceOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getOnlyChildElement
public XmlElement getOnlyChildElement(String childName, String namespace) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
getOnlyChildElement
public XmlElement getOnlyChildElement(String childName) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
getOnlyChildElement
public XmlElement getOnlyChildElement() throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
getTextContent
public String getTextContent() throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
getOnlyTextContentOptionally
public com.google.common.base.Optional<String> getOnlyTextContentOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getNamespaceAttribute
public String getNamespaceAttribute() throws MissingNameSpaceException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
MissingNameSpaceException
-
getNamespaceAttributeOptionally
public com.google.common.base.Optional<String> getNamespaceAttributeOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getNamespaceOptionally
public com.google.common.base.Optional<String> getNamespaceOptionally()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getNamespace
public String getNamespace() throws MissingNameSpaceException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
MissingNameSpaceException
-
toString
public String toString()
Deprecated, for removal: This API element is subject to removal in a future version.
-
findNamespaceOfTextContent
public Map.Entry<String,String> findNamespaceOfTextContent() throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.Search for element's attributes defining namespaces. Look for the one namespace that matches prefix of element's text content. E.g.<type xmlns:th-java="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">th-java:threadfactory-naming </type>
returns {"th-java","urn:.."}. If no prefix is matched, then default namespace is returned with empty string as key. If no default namespace is found value will be null.- Returns:
- prefix - namespace map.
- Throws:
DocumentedException
- namespaces cannot be extracted.
-
getChildElementsWithSameNamespace
public List<XmlElement> getChildElementsWithSameNamespace(String childName) throws MissingNameSpaceException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
MissingNameSpaceException
-
checkUnrecognisedElements
public void checkUnrecognisedElements(List<XmlElement> recognisedElements, XmlElement... additionalRecognisedElements) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
checkUnrecognisedElements
public void checkUnrecognisedElements(XmlElement... additionalRecognisedElements) throws DocumentedException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
DocumentedException
-
equals
public boolean equals(Object obj)
Deprecated, for removal: This API element is subject to removal in a future version.
-
hashCode
public int hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.
-
hasNamespace
public boolean hasNamespace()
Deprecated, for removal: This API element is subject to removal in a future version.
-
-