Class XJdfDocument


  • public class XJdfDocument
    extends java.lang.Object
    This class provides functionality all about XJDF Documents.
    • Constructor Detail

      • XJdfDocument

        public XJdfDocument​(java.lang.String jobId,
                            java.lang.String... types)
                     throws XJdfInitException
        Custom Constructor.
        Accepting the required attributes of an XJDF Document for initializing.
        Parameters:
        jobId - The documents JobID.
        types - The documents types.
        Throws:
        XJdfInitException
      • XJdfDocument

        public XJdfDocument​(XJDF xjdf)
                     throws XJdfInitException
        Custom Constructor.
        Accepting an XJDF root node for initializing.
        Parameters:
        xjdf - The XJDF root node.
        Throws:
        XJdfInitException
    • Method Detail

      • getXJdf

        public XJDF getXJdf()
        Returns the XJDF Documents XJDF root node.
        Returns:
        The XJDF root node.
      • addAudits

        public void addAudits​(Audit... audits)
        Append Audit elements to the XJDF Document.
        Parameters:
        audits - The audits to be appended.
      • addProduct

        public void addProduct​(Product... products)
        Append Product elements to the XJDF Document.
        Parameters:
        products - The products to be appended.
      • addResourceSet

        public ResourceSet addResourceSet​(@NotNull
                                          @NotNull SpecificResource specificResource,
                                          ResourceSet.Usage usage)
        Add a specific resource to the XJDF Document.
        Parameters:
        specificResource - The specific resource to be added.
        usage - The resource's usage.
        Returns:
        The appropriate ResourceSet element for further processing.
      • addResourceSet

        public ResourceSet addResourceSet​(@NotNull
                                          @NotNull SpecificResource specificResource,
                                          ResourceSet.Usage usage,
                                          Part part)
                                   throws java.io.IOException
        Add a specific resource to the XJDF Document.
        Parameters:
        specificResource - The specific resource to be added.
        usage - The resource's usage.
        part - The partitioning of the resource.
        Returns:
        The appropriate ResourceSet element for further processing.
        Throws:
        java.io.IOException
      • addResourceSet

        public ResourceSet addResourceSet​(java.util.Map<Part,​? extends SpecificResource> map,
                                          ResourceSet.Usage usage)
                                   throws java.io.IOException
        Add a map of specific resources to the XJDF Document.
        Parameters:
        map - Partitioned specific resources as map.
        usage - The resource's usage.
        Returns:
        The appropriate ResourceSet element for further processing.
        Throws:
        java.io.IOException
      • getResourceByPart

        public Resource getResourceByPart​(java.lang.Class<? extends SpecificResource> resourceType,
                                          Part part)
                                   throws java.lang.IllegalAccessException
        Identifies and returns the first resource within the XJDF Document using partition keys.
        Parameters:
        resourceType - 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.
      • getResourceByPart

        public Resource getResourceByPart​(java.lang.Class<? extends SpecificResource> resourceType)
                                   throws java.lang.IllegalAccessException
        Identifies and returns the first matching resource within the XJDF Document.
        Parameters:
        resourceType - The class of the specific resource.
        Returns:
        The first Resource identified.
        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> resourceType,
                                                                        Part part)
                                                                 throws java.lang.IllegalAccessException
        Identifies and returns the first matching specific resource within the XJDF Document using partition keys.
        Parameters:
        resourceType - The type 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.
      • getSpecificResourceByPart

        public <T extends SpecificResource> T getSpecificResourceByPart​(java.lang.Class<T> resourceType)
                                                                 throws java.lang.IllegalAccessException
        Identifies and returns the first matching specific resource within the XJDF Document.
        Parameters:
        resourceType - The class of the specific 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.