Package org.cip4.lib.xjdf.xml
Class XJdfNavigator
- java.lang.Object
-
- org.cip4.lib.xjdf.xml.internal.XmlNavigator
-
- org.cip4.lib.xjdf.xml.XJdfNavigator
-
public class XJdfNavigator extends XmlNavigator
Navigator class which simplify XPath handling using XJdf Documents.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAMOUNTXPath to attribute 'Amount' of Product Node in XJDF Document.static java.lang.StringCATEGORYXPath to attribute 'Category' in XJDF Document.static java.lang.StringCOLOR_NUM_COLORSXPath to attribute 'NumColors' of ColorIntent Node in XJDF Document.static java.lang.StringCUSTOMER_IDXPath to attribute 'CustomerID' of CustomerInfo Node in XJDF Document.static java.lang.StringFILE_SPEC_URLXPath to attribute 'URL' of a single RunList/FileSpec definition in XJDF Document.static java.lang.StringFOLD_CATALOGXPath to attribute 'FoldCatalog' of FoldingIntent Node in XJDF Document.static java.lang.StringGENERAL_CATALOG_IDXPath to attribute 'IDValue' of GeneralID 'CatalogID' in XJDF Document.static java.lang.StringGENERAL_LINE_IDXPath to attribute 'IDValue' of GeneralID 'LineID' in XJDF Document.static java.lang.StringJOB_IDXPath to attribute 'JobID' in XJDF Document.static java.lang.StringLAYOUT_DIMENSIONSXPath to attribute 'Dimensions' of LayoutIntent Node in XJDF Document.static java.lang.StringLAYOUT_FINISHED_DIMENSIONSXPath to attribute 'FinishedDimensions' of LayoutIntent Node in XJDF Document.static java.lang.StringMEDIA_QUALITYXPath to attribute 'MediaQuality' of MediaIntent Node in XJDF Document.static java.lang.StringMIN_APPROVALSXPath to attribute 'MinApprovals' of ApprovalParams Node in XJDF Document.static java.lang.StringPRODUCTION_PRINT_PROCESSXPath 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
Constructors Constructor Description XJdfNavigator(byte[] xJdfBytes)Custom constructor.XJdfNavigator(byte[] xJdfBytes, boolean namespaceAware)Custom constructor.XJdfNavigator(java.io.File xjdfFile)Custom constructor.XJdfNavigator(java.io.File xjdfFile, boolean namespaceAware)Custom constructor.XJdfNavigator(java.io.InputStream xJdfStream)Custom constructor.XJdfNavigator(java.io.InputStream xJdfStream, boolean namespaceAware)Custom constructor.XJdfNavigator(java.lang.String xjdfPath)Custom constructor.XJdfNavigator(java.lang.String xjdfPath, boolean namespaceAware)Custom constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectextractNode(java.lang.String xPath)Evaluates an XPath expression on XML Document and returns a parsed Node object as result.voidreplaceNode(java.lang.String xPath, java.lang.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 Detail
-
JOB_ID
public static final java.lang.String JOB_ID
XPath to attribute 'JobID' in XJDF Document.- See Also:
- Constant Field Values
-
CATEGORY
public static final java.lang.String CATEGORY
XPath to attribute 'Category' in XJDF Document.- See Also:
- Constant Field Values
-
GENERAL_CATALOG_ID
public static final java.lang.String GENERAL_CATALOG_ID
XPath to attribute 'IDValue' of GeneralID 'CatalogID' in XJDF Document.- See Also:
- Constant Field Values
-
GENERAL_LINE_ID
public static final java.lang.String GENERAL_LINE_ID
XPath to attribute 'IDValue' of GeneralID 'LineID' in XJDF Document.- See Also:
- Constant Field Values
-
FILE_SPEC_URL
public static final java.lang.String FILE_SPEC_URL
XPath to attribute 'URL' of a single RunList/FileSpec definition in XJDF Document.- See Also:
- Constant Field Values
-
MIN_APPROVALS
public static final java.lang.String MIN_APPROVALS
XPath to attribute 'MinApprovals' of ApprovalParams Node in XJDF Document.- See Also:
- Constant Field Values
-
CUSTOMER_ID
public static final java.lang.String CUSTOMER_ID
XPath to attribute 'CustomerID' of CustomerInfo Node in XJDF Document.- See Also:
- Constant Field Values
-
AMOUNT
public static final java.lang.String AMOUNT
XPath to attribute 'Amount' of Product Node in XJDF Document.- See Also:
- Constant Field Values
-
MEDIA_QUALITY
public static final java.lang.String MEDIA_QUALITY
XPath to attribute 'MediaQuality' of MediaIntent Node in XJDF Document.- See Also:
- Constant Field Values
-
LAYOUT_FINISHED_DIMENSIONS
public static final java.lang.String LAYOUT_FINISHED_DIMENSIONS
XPath to attribute 'FinishedDimensions' of LayoutIntent Node in XJDF Document.- See Also:
- Constant Field Values
-
LAYOUT_DIMENSIONS
public static final java.lang.String LAYOUT_DIMENSIONS
XPath to attribute 'Dimensions' of LayoutIntent Node in XJDF Document.- See Also:
- Constant Field Values
-
PRODUCTION_PRINT_PROCESS
public static final java.lang.String PRODUCTION_PRINT_PROCESS
XPath to attribute 'PrintProcess' of ProductionIntent Node in XJDF Document.- See Also:
- Constant Field Values
-
FOLD_CATALOG
public static final java.lang.String FOLD_CATALOG
XPath to attribute 'FoldCatalog' of FoldingIntent Node in XJDF Document.- See Also:
- Constant Field Values
-
COLOR_NUM_COLORS
public static final java.lang.String COLOR_NUM_COLORS
XPath to attribute 'NumColors' of ColorIntent Node in XJDF Document.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XJdfNavigator
public XJdfNavigator(java.io.InputStream xJdfStream) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOExceptionCustom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfStream- The XJDF Input Stream.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(java.io.InputStream xJdfStream, boolean namespaceAware) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationExceptionCustom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfStream- The XJDF Input Stream.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(java.lang.String xjdfPath) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationExceptionCustom constructor. Accepting a path for initializing.- Parameters:
xjdfPath- The path to the XJDF Document.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(java.lang.String xjdfPath, boolean namespaceAware) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXExceptionCustom constructor. Accepting a path for initializing.- Parameters:
xjdfPath- The path to the XJDF Document.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(java.io.File xjdfFile) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationExceptionCustom constructor. Accepting a file for initializing.- Parameters:
xjdfFile- The file of the XJDF Document.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(java.io.File xjdfFile, boolean namespaceAware) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXExceptionCustom constructor. Accepting a file for initializing.- Parameters:
xjdfFile- The file of the XJDF Document.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(byte[] xJdfBytes) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationExceptionCustom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfBytes- The XJDF as byte array.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
XJdfNavigator
public XJdfNavigator(byte[] xJdfBytes, boolean namespaceAware) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOExceptionCustom constructor. Accepting a XJdf InputStream for initializing.- Parameters:
xJdfBytes- The XJDF as byte array.namespaceAware- True if navigator should be XML Namespace aware.- Throws:
javax.xml.parsers.ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.org.xml.sax.SAXException- - If any parse errors occur.java.io.IOException- - If any IO errors occur.
-
-
Method Detail
-
extractNode
public java.lang.Object extractNode(java.lang.String xPath) throws javax.xml.xpath.XPathExpressionException, jakarta.xml.bind.JAXBExceptionEvaluates 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:
javax.xml.xpath.XPathExpressionExceptionjakarta.xml.bind.JAXBException
-
replaceNode
public void replaceNode(java.lang.String xPath, java.lang.Object replacement) throws javax.xml.xpath.XPathExpressionException, jakarta.xml.bind.JAXBException, javax.xml.parsers.ParserConfigurationExceptionReplace a node in XML Document located by the XPath expression.- Parameters:
xPath- Location of the node to be replaced.replacement- The new node.- Throws:
javax.xml.xpath.XPathExpressionExceptionjakarta.xml.bind.JAXBExceptionjavax.xml.parsers.ParserConfigurationException
-
-