Top Inners Fields Constructors Methods
org.apache.xmpbox.xml

public Class DomXmpParser

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.util.ArrayDeque, .ArrayList, .HashMap, .List, .Map, .Deque, .StringTokenizer, javax.xml.XMLConstants, javax.xml.namespace.QName, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, .ParserConfigurationException, org.apache.xmpbox.XMPMetadata, .XmpConstants, org.apache.xmpbox.schema.XMPSchema, .XmpSchemaException, org.apache.xmpbox.type.AbstractField, .AbstractSimpleProperty, .AbstractStructuredType, .ArrayProperty, .Attribute, .BadFieldValueException, .Cardinality, .ComplexPropertyContainer, .PropertiesDescription, .PropertyType, .TypeMapping, .Types, org.apache.xmpbox.xml.XmpParsingException.ErrorType, org.w3c.dom.Attr, .Comment, .Document, .Element, .NamedNodeMap, .Node, .NodeList, .ProcessingInstruction, .Text, org.xml.sax.SAXException

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
private DocumentBuilder
private DomXmpParser.NamespaceFinder
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private PropertyType
private void
private void
expectNaming(Element element, String ns, String prefix, String ln)

private Element
private AbstractStructuredType
instanciateStructured(TypeMapping tm, Types type, String name, String structuredNamespace)

public boolean
private void
private void
private void
private void
private void
private void
public XMPMetadata
parse(byte[] xmp)

public XMPMetadata
private void
private void
private void
private void
private void
private XMPMetadata
private AbstractStructuredType
parseLiDescription(XMPMetadata xmp, QName descriptor, Element liElement)

private AbstractField
parseLiElement(XMPMetadata xmp, QName descriptor, Element liElement, Types type)

private void
removeComments(Node
the first node of an element or document to clear
root
)

Remove all the comments node in the parent element of the parameter

public void
setStrictParsing(boolean strictParsing)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dBuilderback to summary
private DocumentBuilder dBuilder
nsFinderback to summary
private DomXmpParser.NamespaceFinder nsFinder
strictParsingback to summary
private boolean strictParsing

Constructor Detail

DomXmpParserback to summary
public DomXmpParser() throws XmpParsingException

Method Detail

checkPropertyDefinitionback to summary
private PropertyType checkPropertyDefinition(XMPMetadata xmp, QName prop) throws XmpParsingException
createPropertyback to summary
private void createProperty(XMPMetadata xmp, Element property, PropertyType type, ComplexPropertyContainer container) throws XmpParsingException
expectNamingback to summary
private void expectNaming(Element element, String ns, String prefix, String ln) throws XmpParsingException
findDescriptionsParentback to summary
private Element findDescriptionsParent(Element root) throws XmpParsingException
instanciateStructuredback to summary
private AbstractStructuredType instanciateStructured(TypeMapping tm, Types type, String name, String structuredNamespace) throws XmpParsingException
isStrictParsingback to summary
public boolean isStrictParsing()
loadAttributesback to summary
private void loadAttributes(AbstractField sp, Element element)
manageArrayback to summary
private void manageArray(XMPMetadata xmp, Element property, PropertyType type, ComplexPropertyContainer container) throws XmpParsingException
manageDefinedTypeback to summary
private void manageDefinedType(XMPMetadata xmp, Element property, String prefix, ComplexPropertyContainer container) throws XmpParsingException
manageLangAltback to summary
private void manageLangAlt(XMPMetadata xmp, Element property, ComplexPropertyContainer container) throws XmpParsingException
manageSimpleTypeback to summary
private void manageSimpleType(XMPMetadata xmp, Element property, Types type, ComplexPropertyContainer container)
manageStructuredTypeback to summary
private void manageStructuredType(XMPMetadata xmp, Element property, String prefix, ComplexPropertyContainer container) throws XmpParsingException
parseback to summary
public XMPMetadata parse(byte[] xmp) throws XmpParsingException
parseback to summary
public XMPMetadata parse(InputStream input) throws XmpParsingException
parseChildrenAsPropertiesback to summary
private void parseChildrenAsProperties(XMPMetadata xmp, List<Element> properties, TypeMapping tm, Element description) throws XmpParsingException, XmpSchemaException
parseDescriptionInnerback to summary
private void parseDescriptionInner(XMPMetadata xmp, Element description, ComplexPropertyContainer parentContainer) throws XmpParsingException
parseDescriptionRootback to summary
private void parseDescriptionRoot(XMPMetadata xmp, Element description) throws XmpParsingException
parseDescriptionRootAttrback to summary
private void parseDescriptionRootAttr(XMPMetadata xmp, Element description, Attr attr, TypeMapping tm) throws XmpSchemaException, XmpParsingException
parseEndPacketback to summary
private void parseEndPacket(XMPMetadata metadata, ProcessingInstruction pi) throws XmpParsingException
parseInitialXpacketback to summary
private XMPMetadata parseInitialXpacket(ProcessingInstruction pi) throws XmpParsingException
parseLiDescriptionback to summary
private AbstractStructuredType parseLiDescription(XMPMetadata xmp, QName descriptor, Element liElement) throws XmpParsingException
parseLiElementback to summary
private AbstractField parseLiElement(XMPMetadata xmp, QName descriptor, Element liElement, Types type) throws XmpParsingException
removeCommentsback to summary
private void removeComments(Node root)

Remove all the comments node in the parent element of the parameter

Parameters
root:Node

the first node of an element or document to clear

setStrictParsingback to summary
public void setStrictParsing(boolean strictParsing)
org.apache.xmpbox.xml back to summary

protected Class DomXmpParser.NamespaceFinder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Deque<Map<String, String>>

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected boolean
protected Map<String, String>
pop()

protected void
push(Element description)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

stackback to summary
private final Deque<Map<String, String>> stack

Constructor Detail

NamespaceFinderback to summary
protected NamespaceFinder()

Method Detail

containsNamespaceback to summary
protected boolean containsNamespace(String namespace)
popback to summary
protected Map<String, String> pop()
pushback to summary
protected void push(Element description)