Class JDFDevCaps

java.lang.Object
org.apache.xerces.dom.NodeImpl
org.apache.xerces.dom.ChildNode
org.apache.xerces.dom.ParentNode
org.apache.xerces.dom.ElementImpl
org.apache.xerces.dom.ElementNSImpl
All Implemented Interfaces:
Serializable, Cloneable, ICapabilityElement, IStreamWriter, Element, ElementTraversal, EventTarget, Node, NodeList, TypeInfo

public class JDFDevCaps extends JDFAutoDevCaps implements ICapabilityElement
See Also:
  • Constructor Details

    • JDFDevCaps

      public JDFDevCaps(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String qualifiedName)
      Constructor for JDFDevCaps
      Parameters:
      myOwnerDocument -
      qualifiedName -
    • JDFDevCaps

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

      public JDFDevCaps(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String myNamespaceURI, String qualifiedName, String myLocalName)
      Constructor for JDFDevCaps
      Parameters:
      myOwnerDocument -
      myNamespaceURI -
      qualifiedName -
      myLocalName -
  • Method Details

    • toString

      public String toString()
      Description copied from class: KElement
      this to string, used for debug purpose mostly
      Overrides:
      toString in class KElement
      Returns:
      string representativ of this
      See Also:
    • setDevCapRef

      public void setDevCapRef(String value)
      set attribute DevCapRef
      Parameters:
      value - the value to set the attribute to
    • setDevCapRef

      public void setDevCapRef(JDFDevCap dc)
      set rRef to the value of devCap/@ID
      Parameters:
      dc - the DevCap to set
    • appendDevCap

      public JDFDevCap appendDevCap()
      set rRef to the value of devCap/@ID
      Overrides:
      appendDevCap in class JDFAutoDevCaps
      Parameters:
      deviceCap - the DevCap to set
      Returns:
      JDFDevCap the element
    • appendDevCapInPool

      public JDFDevCap appendDevCapInPool()
      set rRef to the value of devCap/@ID
      Parameters:
      deviceCap - the DevCap to set
    • getDevCapPool

      public JDFDevCapPool getDevCapPool()
      get the DevCapPool that contains devcap elements referenced by this
      Returns:
      JDFDevCapPool the pool
    • getModulePool

      public JDFModulePool getModulePool()
      get the DEvCapPool that contains devcap elements referenced by this
      Specified by:
      getModulePool in interface ICapabilityElement
      Returns:
      JDFDevCapPool the pool
    • getCreateModulePool

      public JDFModulePool getCreateModulePool()
      get the DEvCapPool that contains devcap elements referenced by this
      Specified by:
      getCreateModulePool in interface ICapabilityElement
      Returns:
      JDFDevCapPool the pool
    • getCreateDevCapPool

      public JDFDevCapPool getCreateDevCapPool()
      get the DevCapPool that contains devcap elements referenced by this create one if it does not exist
      Returns:
      JDFDevCapPool the pool
    • getDevCap

      public JDFDevCap getDevCap()
      get the one and only devCap - note that the spec allows *, but recommends only one + additional actions.
      Also search devCapPool for a matching element to DevCapRef.
      Overrides:
      getDevCap in class JDFAutoDevCaps
      Returns:
      the DevCap
    • getNamePath

      @Deprecated public final String getNamePath(boolean onlyNames)
      Deprecated.
      use getNamePathVector
      getNamePath - gets the NamePath of this DevCaps in form "DevCapsName[Context=bbb, LinkUsage=ccc]/"

      default: getNamePath(false)

      Parameters:
      onlyNames - if true, returns only DevCapsName. Default=false
      Returns:
      String - NamePath of this DevCaps
    • getNamePathVector

      public final VString getNamePathVector()
      Gets the NamePath of this DevCap in form " DevCapsName/SubelemName1/SubelemName2/..."
      If this DevCap is located in DevCapPool and not in a DevCaps, it describes the reusable resource. In this case DevCap root will have the attribute "Name" = value of DevCaps/@Name, but will have no info about DevCaps/@Context or DevCaps/@LinkUsage.

      default: getNamePath(false)

      Specified by:
      getNamePathVector in interface ICapabilityElement
      Parameters:
      bRecurse - if true, returns " DevCapsName/SubelemName1/SubelemName2/..."
      Returns:
      String - NamePath of this DevCap
    • getDevCapVector

      public final VElement getDevCapVector()
      getDevCapVector()
      Returns:
      VElement
    • devCapReport

      public final KElement devCapReport(KElement elem, JDFBaseDataTypes.EnumFitsValue testlists, JDFElement.EnumValidationLevel level, boolean ignoreExtensions, KElement parentReport)
      devCapReport - tests if the elements in vElem fit any (logical OR) DevCap element that DevCaps consists of. Composes a detailed report in XML form of the errors found. If XMLDoc is null there are no errors.
      DevCaps will be checked if they are direct children of this and referenced in DevCapPool.
      Parameters:
      vElem - vector of the elements to test
      testlists - testlists that are specified for the State elements (FitsValue_Allowed or FitsValue_Present)
      Will be used in fitsValue method of the State element.
      level - validation level
      Returns:
      XMLDoc - XMLDoc output of the error messages.
      If XMLDoc is null there are no errors, every element of vElem fits any DevCap element of this.
      Throws:
      JDFException - if DevCaps/@DevCapRef refers to the DevCap elements in a non-existent DevCapPool
      JDFException - if DevCaps/@DevCapRef refers to the non-existent DevCap
    • getContextName

      public String getContextName()
      same as getName, except that "Link" is appended in case of @Context="Link"
      Returns:
      the element name mangled by context
    • getMatchingElementsFromJMF

      public VElement getMatchingElementsFromJMF(JDFMessage messageElement)
      gets the matching elements in node that match this devcaps
      Parameters:
      node - the node to search in
      Returns:
      VElement - the element vector of matching elements, null if none were found
    • appendMatchingElementsToNode

      public KElement appendMatchingElementsToNode(JDFNode node, boolean bAll, VectorMap indexResMap, boolean bLink)
      append elements to the node that match this DevCap, if they do not exist yet
      Parameters:
      node - the node to append the elements to
      bAll - if false, only add if minOccurs>=1 and required=true or a default exists
      Returns:
      KElement - the last element that was appended
    • setDefaultsFromCaps

      public boolean setDefaultsFromCaps(JDFNode node, boolean bAll)
      sets default elements and adds them, if there are less than minOccurs
      Parameters:
      node - the node to set
      bAll - if false, only add if minOccurs>=1 and required=true or a default exists, if true, always create one
      Returns:
      boolean true if a default element was created, else false
    • getMaxOccurs

      public int getMaxOccurs()
      return the highest maxOccurs of all devCap elements
      Returns:
      int - the highest maxOccurs of all devCap elements
    • getMinOccurs

      public int getMinOccurs()
      return the lowest minOccurs of all devCap elements
      Returns:
      int - the lowest minOccurs of all devCap elements
    • analyzeDevCaps

      public void analyzeDevCaps(KElement testRoot, JDFBaseDataTypes.EnumFitsValue testlists, JDFElement.EnumValidationLevel level, KElement mrp, KElement irp, HashSet goodElems, HashMap badElems, boolean ignoreExtensions)
      Parameters:
      testRoot -
      testlists -
      level -
      mrp -
      irp -
      resLinkPool -
      goodElems -
      badElems -
      devCaps -
    • getModuleAvailability

      public JDFDeviceCap.EnumAvailability getModuleAvailability()
      get the availability of this devcaps based on the list of installed modules in ModuleRefs and ModulePool
      Returns:
    • getInvalidAttributes

      public VString getInvalidAttributes(JDFElement.EnumValidationLevel level, boolean bIgnorePrivate, int nMax)
      Description copied from class: JDFElement
      get invalid attributes
      Overrides:
      getInvalidAttributes in class JDFElement
      Parameters:
      level - validation level
      bIgnorePrivate - if true, do not worry about attributes in other namespaces
      nMax - maximum size of the returned vector
      Returns:
      VString - a vector of invalid attribute names
    • appendModuleRef

      public JDFModuleCap appendModuleRef(String id)
      Description copied from interface: ICapabilityElement
      append moduleRef to moduleRefs, if it does not exist, set the availability to module and ensure that the appropriate modulecap exists
      Specified by:
      appendModuleRef in interface ICapabilityElement
      Returns:
      JDFModuleCap the Modulecap that id refers tp
    • getEvaluationType

      public JDFTerm.EnumTerm getEvaluationType()
      Description copied from interface: ICapabilityElement
      get the type of evaluation that is appropriate for this ICapabilityElement
      Specified by:
      getEvaluationType in interface ICapabilityElement
      Returns:
      EnumTerm the type of evaluation