Class XJdfDocument


  • public class XJdfDocument
    extends java.lang.Object
    XJDF Document is designed to be the main class when dealing with XJDF documents. Most of the logic covered by the XJDF library is covered by this class.
    • Constructor Detail

      • XJdfDocument

        public XJdfDocument​(java.lang.String jobId,
                            java.lang.String[] types)
        Custom Constructor. Accepting the fundamentals of an XJDF Document for initializing
      • XJdfDocument

        public XJdfDocument​(byte[] bytes)
                     throws jakarta.xml.bind.JAXBException
        Custom Constructor. Accepting an XJDF byte array for initializing
        Throws:
        jakarta.xml.bind.JAXBException
      • XJdfDocument

        public XJdfDocument​(XJDF xjdf)
        Custom Constructor. Accepting an XJDF Node for initializing
    • Method Detail

      • getXJdf

        public XJDF getXJdf()
        Returns the documents XJDF root node.
        Returns:
        The XJDF node.
      • isValidation

        public boolean isValidation()
        Returns true in case the XJDF Document should be validated before writing.
        Returns:
        True in case the XJDF Document should be validated before writing
      • setValidation

        public void setValidation​(boolean validation)
        Set true if the document should become validated before writing.
        Parameters:
        validation - True in case for validation, otherwise false.
      • toXml

        public java.lang.String toXml()
                               throws jakarta.xml.bind.JAXBException,
                                      java.io.IOException
        Returns the current XJDF Node as String
        Returns:
        The XJDF Node as String.
        Throws:
        jakarta.xml.bind.JAXBException
        java.io.IOException
      • getXJdfPackage

        public byte[] getXJdfPackage()
                              throws PackagerException
        Returns an XJDF Zip Package containing the document and all assets.
        Returns:
        The XJDF Zip Pacakge.
        Throws:
        PackagerException
      • addAudit

        public void addAudit​(Audit audit)
        Append a Audit to the XJDF Document.
        Parameters:
        audit - The audit to be attended append.
      • getResourceByPart

        public Resource getResourceByPart​(java.lang.Class<? extends SpecificResource> resourceClazz,
                                          Part part)
                                   throws java.lang.IllegalAccessException
        Identifies and returns the first resource within the XJDF Document using partition keys.
        Parameters:
        resourceClazz - The class of the specific resource.
        part - The given Partition Keys used to identify a particular Resource
        Returns:
        The first Resource identified using partition keys.
        Throws:
        java.lang.IllegalAccessException - Is thrown in case the partition isn't accessible in Part class.
      • getSpecificResourceByPart

        public <T extends SpecificResource> T getSpecificResourceByPart​(java.lang.Class<T> resourceClazz,
                                                                        Part part)
                                                                 throws java.lang.IllegalAccessException
        Identifies and returns the first specific resource within the XJDF Document using partition keys.
        Parameters:
        resourceClazz - The class of the specific resource.
        part - The given Partition Keys used to identify a particular Resource
        Returns:
        The first specific resource identified using partition keys.
        Throws:
        java.lang.IllegalAccessException - Is thrown in case the partition isn't accessible in Part class.