Package org.cip4.lib.xjdf.xml
Class XJdfNavigator
java.lang.Object
org.cip4.lib.xjdf.xml.internal.XmlNavigator
org.cip4.lib.xjdf.xml.XJdfNavigator
Navigator class which simplify XPath handling using XJdf Documents.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXPath to attribute 'Amount' of Product Node in XJDF Document.static final StringXPath to attribute 'Category' in XJDF Document.static final StringXPath to attribute 'NumColors' of ColorIntent Node in XJDF Document.static final StringXPath to attribute 'CustomerID' of CustomerInfo Node in XJDF Document.static final StringXPath to attribute 'URL' of a single RunList/FileSpec definition in XJDF Document.static final StringXPath to attribute 'FoldCatalog' of FoldingIntent Node in XJDF Document.static final StringXPath to attribute 'IDValue' of GeneralID 'CatalogID' in XJDF Document.static final StringXPath to attribute 'IDValue' of GeneralID 'LineID' in XJDF Document.static final StringXPath to attribute 'JobID' in XJDF Document.static final StringXPath to attribute 'Dimensions' of LayoutIntent Node in XJDF Document.static final StringXPath to attribute 'FinishedDimensions' of LayoutIntent Node in XJDF Document.static final StringXPath to attribute 'MediaQuality' of MediaIntent Node in XJDF Document.static final StringXPath to attribute 'MinApprovals' of ApprovalParams Node in XJDF Document.static final StringXPath to attribute 'PrintProcess' of ProductionIntent Node in XJDF Document.Fields inherited from class org.cip4.lib.xjdf.xml.internal.XmlNavigator
nsManager, xmlDocument, xPath -
Constructor Summary
ConstructorsConstructorDescriptionXJdfNavigator(byte[] xJdfBytes) Custom constructor.XJdfNavigator(byte[] xJdfBytes, boolean namespaceAware) Custom constructor.XJdfNavigator(File xjdfFile) Custom constructor.XJdfNavigator(File xjdfFile, boolean namespaceAware) Custom constructor.XJdfNavigator(InputStream xJdfStream) Custom constructor.XJdfNavigator(InputStream xJdfStream, boolean namespaceAware) Custom constructor.XJdfNavigator(String xjdfPath) Custom constructor.XJdfNavigator(String xjdfPath, boolean namespaceAware) Custom constructor. -
Method Summary
Modifier and TypeMethodDescriptionextractNode(String xPath) Evaluates an XPath expression on XML Document and returns a parsed Node object as result.voidreplaceNode(String xPath, Object replacement) Replace a node in XML Document located by the XPath expression.Methods inherited from class org.cip4.lib.xjdf.xml.internal.XmlNavigator
addNamespace, evaluate, evaluateBoolean, evaluateDouble, evaluateInt, evaluateLong, evaluateNode, evaluateNodeList, evaluateString, extractNode, getXmlBytes, getXmlDocument, getXmlStream, readAttribute, readAttribute, removeNode, replaceNode, updateAttribute, updateAttribute
-
Field Details
-
JOB_ID
XPath to attribute 'JobID' in XJDF Document.- See Also:
-
CATEGORY
XPath to attribute 'Category' in XJDF Document.- See Also:
-
GENERAL_CATALOG_ID
XPath to attribute 'IDValue' of GeneralID 'CatalogID' in XJDF Document.- See Also:
-
GENERAL_LINE_ID
XPath to attribute 'IDValue' of GeneralID 'LineID' in XJDF Document.- See Also:
-
FILE_SPEC_URL
XPath to attribute 'URL' of a single RunList/FileSpec definition in XJDF Document.- See Also:
-
MIN_APPROVALS
XPath to attribute 'MinApprovals' of ApprovalParams Node in XJDF Document.- See Also:
-
CUSTOMER_ID
XPath to attribute 'CustomerID' of CustomerInfo Node in XJDF Document.- See Also:
-
AMOUNT
XPath to attribute 'Amount' of Product Node in XJDF Document.- See Also:
-
MEDIA_QUALITY
XPath to attribute 'MediaQuality' of MediaIntent Node in XJDF Document.- See Also:
-
LAYOUT_FINISHED_DIMENSIONS
XPath to attribute 'FinishedDimensions' of LayoutIntent Node in XJDF Document.- See Also:
-
LAYOUT_DIMENSIONS
XPath to attribute 'Dimensions' of LayoutIntent Node in XJDF Document.- See Also:
-
PRODUCTION_PRINT_PROCESS
XPath to attribute 'PrintProcess' of ProductionIntent Node in XJDF Document.- See Also:
-
FOLD_CATALOG
XPath to attribute 'FoldCatalog' of FoldingIntent Node in XJDF Document.- See Also:
-
COLOR_NUM_COLORS
XPath to attribute 'NumColors' of ColorIntent Node in XJDF Document.- See Also:
-
-
Constructor Details
-
XJdfNavigator
public XJdfNavigator(InputStream xJdfStream) throws ParserConfigurationException, SAXException, IOException Custom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfStream- The XJDF Input Stream.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(InputStream xJdfStream, boolean namespaceAware) throws IOException, SAXException, ParserConfigurationException Custom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfStream- The XJDF Input Stream.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(String xjdfPath) throws IOException, SAXException, ParserConfigurationException Custom constructor. Accepting a path for initializing.- Parameters:
xjdfPath- The path to the XJDF Document.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(String xjdfPath, boolean namespaceAware) throws IOException, ParserConfigurationException, SAXException Custom constructor. Accepting a path for initializing.- Parameters:
xjdfPath- The path to the XJDF Document.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
XJdfNavigator
Custom constructor. Accepting a file for initializing.- Parameters:
xjdfFile- The file of the XJDF Document.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(File xjdfFile, boolean namespaceAware) throws IOException, ParserConfigurationException, SAXException Custom constructor. Accepting a file for initializing.- Parameters:
xjdfFile- The file of the XJDF Document.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(byte[] xJdfBytes) throws IOException, SAXException, ParserConfigurationException Custom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfBytes- The XJDF as byte array.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(byte[] xJdfBytes, boolean namespaceAware) throws ParserConfigurationException, SAXException, IOException Custom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfBytes- The XJDF as byte array.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.SAXException- - If any parse errors occur.IOException- - If any IO errors occur.
-
-
Method Details
-
extractNode
public Object extractNode(String xPath) throws XPathExpressionException, javax.xml.bind.JAXBException Evaluates an XPath expression on XML Document and returns a parsed Node object as result.- Parameters:
xPath- XPath expression to execute to.- Returns:
- The parsed XJDF Node object.
- Throws:
XPathExpressionExceptionjavax.xml.bind.JAXBException
-
replaceNode
public void replaceNode(String xPath, Object replacement) throws XPathExpressionException, javax.xml.bind.JAXBException, ParserConfigurationException Replace a node in XML Document located by the XPath expression.- Parameters:
xPath- Location of the node to be replaced.replacement- The new node.- Throws:
XPathExpressionExceptionjavax.xml.bind.JAXBExceptionParserConfigurationException
-