Package org.cip4.lib.xjdf
Class XJdfDocument
- java.lang.Object
-
- org.cip4.lib.xjdf.XJdfDocument
-
public class XJdfDocument extends java.lang.ObjectXJDF 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 Summary
Constructors Constructor Description XJdfDocument(byte[] bytes)Custom Constructor.XJdfDocument(java.lang.String jobId, java.lang.String[] types)Custom Constructor.XJdfDocument(XJDF xjdf)Custom Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAudit(Audit audit)Append a Audit to the XJDF Document.ResourceSetaddResourceSet(@NotNull SpecificResource specificResource, ResourceSet.Usage usage)ResourceSetaddResourceSet(@NotNull SpecificResource specificResource, ResourceSet.Usage usage, Part part)ResourceSetaddResourceSet(java.util.Map<Part,? extends SpecificResource> map, ResourceSet.Usage usage)ResourcegetResourceByPart(java.lang.Class<? extends SpecificResource> resourceClazz, Part part)Identifies and returns the first resource within the XJDF Document using partition keys.<T extends SpecificResource>
TgetSpecificResourceByPart(java.lang.Class<T> resourceClazz, Part part)Identifies and returns the first specific resource within the XJDF Document using partition keys.XJDFgetXjdf()Returns the documents XJDF root node.
-
-
-
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 javax.xml.bind.JAXBExceptionCustom Constructor. Accepting an XJDF byte array for initializing- Throws:
javax.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.
-
addAudit
public void addAudit(Audit audit)
Append a Audit to the XJDF Document.- Parameters:
audit- The audit to be attended append.
-
addResourceSet
public ResourceSet addResourceSet(@NotNull @NotNull SpecificResource specificResource, ResourceSet.Usage usage)
-
addResourceSet
public ResourceSet addResourceSet(@NotNull @NotNull SpecificResource specificResource, ResourceSet.Usage usage, Part part)
-
addResourceSet
public ResourceSet addResourceSet(java.util.Map<Part,? extends SpecificResource> map, ResourceSet.Usage usage)
-
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.
-
-