Class JDFResourceLinkPool

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, IStreamWriter, org.w3c.dom.Element, org.w3c.dom.ElementTraversal, org.w3c.dom.events.EventTarget, org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.TypeInfo

    public class JDFResourceLinkPool
    extends JDFPool
    See Also:
    Serialized Form
    • Constructor Detail

      • JDFResourceLinkPool

        public JDFResourceLinkPool​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                                   java.lang.String qualifiedName)
        Constructor for JDFResourceLinkPool
        Parameters:
        myOwnerDocument -
        qualifiedName -
      • JDFResourceLinkPool

        public JDFResourceLinkPool​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                                   java.lang.String myNamespaceURI,
                                   java.lang.String qualifiedName)
        Constructor for JDFResourceLinkPool
        Parameters:
        myOwnerDocument -
        myNamespaceURI -
        qualifiedName -
      • JDFResourceLinkPool

        public JDFResourceLinkPool​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                                   java.lang.String myNamespaceURI,
                                   java.lang.String qualifiedName,
                                   java.lang.String myLocalName)
        Constructor for JDFResourceLinkPool
        Parameters:
        myOwnerDocument -
        myNamespaceURI -
        qualifiedName -
        myLocalName -
    • Method Detail

      • toString

        public java.lang.String toString()
        toString
        Overrides:
        toString in class KElement
        Returns:
        String
        See Also:
        Object.toString()
      • getLinks

        @Deprecated
        public VElement getLinks​(JDFAttributeMap mLinkAtt)
        Deprecated.
        use getPoolChildren()
        GetLinks - get the links matching mLinkAtt out of the resource link pool

        default: GetLinks(null)

        Parameters:
        mLinkAtt - the attributes to search for
        Returns:
        mLinkAtt vector all all elements matching the condition mLinkAtt
      • getLinks

        @Deprecated
        public VElement getLinks​(java.lang.String elementName,
                                 java.lang.String nameSpaceURI)
        Deprecated.
        use getPoolChildren()
        GetLinks - get the links matching elementName/nameSpaceURI from the resource pool
        if you need all links in the doc, call getLinks from JDFElement

        default: GetLinks(null, null)

        Parameters:
        elementName - Name of the Linked resource
        nameSpaceURI - the namespace to search in
        Returns:
        VElement - vector all all elements matching the condition mLinkAtt
      • getLinkedResources

        @Deprecated
        public VElement getLinkedResources​(java.lang.String resName,
                                           JDFAttributeMap mLinkAtt,
                                           JDFAttributeMap mResAtt,
                                           boolean bFollowRefs)
        Deprecated.
        - use namespace enabled version getLinkedResources(resName, mLinkAtt, mResAtt, bFollowRefs, null);
        Get the linked resources matching some conditions

        default: GetLinkedResources(null, null, null, false)

        Parameters:
        resName - type(Name) of the resource to get
        mLinkAtt - the link attribute to search for
        mResAtt - attribute to search for
        bFollowRefs - if true search all HRefs and add them to the list
        Returns:
        VElement - vector with all Resources matching the conditions
      • getLinkedResources

        public VElement getLinkedResources​(java.lang.String resName,
                                           JDFAttributeMap mLinkAtt,
                                           JDFAttributeMap mResAtt,
                                           boolean bFollowRefs,
                                           java.lang.String nameSpaceURI)
        Get the linked resources matching some conditions

        default: GetLinkedResources(null, null, null, false)

        Parameters:
        resName - type(Name) of the resource to get
        mLinkAtt - the link attribute to search for
        mResAtt - attribute to search for
        bFollowRefs - if true search all HRefs and add them to the list
        nameSpaceURI -
        Returns:
        VElement - vector with all Resources matching the conditions
      • getInOutLinks

        @Deprecated
        public VElement getInOutLinks​(boolean bInOut,
                                      boolean bLink,
                                      java.lang.String resName,
                                      java.lang.String resProcUsage)
        Deprecated.
        use getInOutLinks with EnumUsage signature
        GetInOutLinks - get the links from the pool (input or output)

        default: GetInOutLinks(bInOut, true, JDFConstants.WILDCARD, JDFConstants.WILDCARD)

        Parameters:
        bInOut - what kind of links you want to have (true for input)
        bLink - if true, return the resource links. if false return the resources
        resName - type of the resource to get ( * for all)
        resProcUsage - process usage of the resource to get (* for all)
        Returns:
        VElement - Vector with the found resource links
      • getInOutLinks

        public VElement getInOutLinks​(JDFResourceLink.EnumUsage usage,
                                      boolean bLink,
                                      java.lang.String resName,
                                      JDFNode.EnumProcessUsage procUsage)
        GetInOutLinks - get the links from the pool (input or output)

        default: GetInOutLinks(null, true, null, null)

        Parameters:
        usage - what kind of links you want to have (input, output). If null all are selected.
        bLink - if true, return the resource links. if false return the resources
        resName - name of the resource to get ( * for all)
        procUsage - process usage of the resource to get
        Returns:
        VElement - Vector with the found resource links
      • getInOutLinksExtended

        public VElement getInOutLinksExtended​(JDFResourceLink.EnumUsage usage,
                                              boolean bLink,
                                              java.lang.String resName,
                                              java.lang.String procUsage,
                                              java.lang.String namespaceURI,
                                              boolean bAll)
        getInOutLinksExtended - get the links from the pool (input or output)

        default: GetInOutLinks(null, true, null, null)

        Parameters:
        usage - what kind of links you want to have (input, output). If null all are selected.
        bLink - if true, return the resource links. if false return the resources
        resName - name of the resource to get ( * or null for all)
        procUsage - process usage of the resource to get
        namespaceURI -
        bAll -
        Returns:
        VElement - Vector with the found resource links
      • resourceVector

        public static VElement resourceVector​(VElement linkVector,
                                              java.lang.String resType)
        ResourceVector - convert a link vector to a resource vector
        Parameters:
        linkVector - vector to convert
        resType - kind of resType to add ( * for all)
        Returns:
        VElement - the converted vector
      • appendResource

        @Deprecated
        public JDFResourceLink appendResource​(JDFResource r,
                                              boolean input,
                                              boolean bForce)
        Deprecated.
        AppendResource - append resource r to this link pool

        default: AppendResource(r, input, false)

        Parameters:
        r - the resource to append
        input - usage of the link (true = inout, false = output)
        bForce - if true create the link, even though it already exists - now ignored since it is useless
        Returns:
        JDFResourceLink - link to appended resource
        Throws:
        JDFException - if r is not in the same document as this
      • getLink

        public JDFResourceLink getLink​(JDFResource r,
                                       JDFResourceLink.EnumUsage usage,
                                       JDFNode.EnumProcessUsage processUsage)
        getLink - get the resourcelink that resides in the ResourceLinkPool of this node and references the resource r

        default: getLink(r, EnumUsage.Input, null)

        Parameters:
        r - the resource you are searching a link for
        usage - usage of the link (input/output)
        processUsage - ProcessUsage of the link
        Returns:
        JDFResourceLink - the resource link you were searching for. If not found, a new empty JDFResourceLink is returned.
      • linkResource

        public JDFResourceLink linkResource​(JDFResource r,
                                            JDFResourceLink.EnumUsage usage,
                                            JDFNode.EnumProcessUsage processUsage)
        linkResource - link resource r to this link pool

        default: linkResource(r, usage, null)

        Parameters:
        r - the resource to link
        usage - usage of the link
        processUsage - processUsage of the link, null if none
        Returns:
        JDFResourceLink - new link resource, null if an error occurred
      • getPartMapVector

        public VJDFAttributeMap getPartMapVector​(boolean bComplete)
        getPartMapVector - get the part map vector from the actual element
        Parameters:
        bComplete - if true, expand all parts defined in PartIDKeys
        Returns:
        VJDFAttributeMap - map of all parts linked by this resourcelinkpool
      • getPartIDKeys

        public VString getPartIDKeys()
        get a vector of all part id keys linked
        Returns:
        Vector
      • getPartValues

        public VString getPartValues​(JDFResource.EnumPartIDKey partType)
        GetPartValues - get a list of the values for attribute partType within the leaves of all linked resources
        Parameters:
        partType - the attribute name you which to get the values
        Returns:
        Vector - vector with all values of the attribute partType
      • getLinkArray

        public java.util.List<JDFResourceLink> getLinkArray()
        Returns:
      • getPoolChildren

        public VElement getPoolChildren​(java.lang.String strName,
                                        JDFAttributeMap mAttrib,
                                        java.lang.String nameSpaceURI)
        Gets all children with the attribute name, mAttrib, nameSpaceURI out of the pool
        Parameters:
        strName - name of the Child
        mAttrib - a attribute to search for
        nameSpaceURI - the namespace uri
        Returns:
        VElement: a vector with all elements in the pool matching the conditions default: getPoolChildren(null, null, null)
      • getPoolChild

        public JDFResourceLink getPoolChild​(int i,
                                            java.lang.String strName,
                                            JDFAttributeMap mAttrib,
                                            java.lang.String nameSpaceURI)
        get a child resource from the pool matching the parameters
        Parameters:
        i - the index of the child, or -1 to make a new one.
        strName - the name of the element
        mAttrib - the attribute of the element
        nameSpaceURI - the namespace to search in
        Returns:
        JDFElement: the pool child matching the above conditions
      • getUnknownElements

        public VString getUnknownElements​(boolean bIgnorePrivate,
                                          int nMax)
        return a vector of unknown element nodenames

        default: GetInvalidElements(true, 999999)

        Overrides:
        getUnknownElements in class JDFElement
        Parameters:
        bIgnorePrivate - used by JDFElement during the validation
        nMax - maximum size of the returned vector
        Returns:
        Vector - vector of unknown element nodenames !!! Do not change the signature of this method
      • getAllRefs

        public java.util.HashSet<JDFElement> getAllRefs​(java.util.HashSet<JDFElement> vDoneRefs,
                                                        boolean bRecurse)
        get inter-resource linked resource ids
        Overrides:
        getAllRefs in class JDFElement
        Parameters:
        vDoneRefs - (null, used for recursion)
        bRecurse - if true, also return recursively linked IDS
        Returns:
        vElement: the vector of referenced resource ids