Class JDFDeviceCap

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, IDeviceCapable, IStreamWriter, Element, ElementTraversal, EventTarget, Node, NodeList, TypeInfo

public class JDFDeviceCap extends JDFAutoDeviceCap implements IDeviceCapable
See Also:
  • Field Details

  • Constructor Details

    • JDFDeviceCap

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

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

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

    • getTheElementInfo

      protected ElementInfo getTheElementInfo()
      Overrides:
      getTheElementInfo in class JDFAutoDeviceCap
      Returns:
      the elementinfo
    • toString

      public String toString()
      toString - StringRepresentation of JDFNode
      Overrides:
      toString in class KElement
      Returns:
      String
      See Also:
    • getTypeExpression

      public String getTypeExpression()
      Gets of this string attribute TypeExpression if it exists, otherwise returns the literal string defined in Types
      Overrides:
      getTypeExpression in class JDFAutoDeviceCap
      Returns:
      String - TypeExpression attribute value
    • getCombinedMethod

      public Vector getCombinedMethod()
      (9.2) get CombinedMethod attribute CombinedMethod
      Overrides:
      getCombinedMethod in class JDFAutoDeviceCap
      Returns:
      Vector of the enumerations
    • getNamePathVector

      public final VString getNamePathVector()
      Specified by:
      getNamePathVector in interface IDeviceCapable
      Returns:
    • getExecutableJDF

      public final VElement getExecutableJDF(JDFNode jdfRoot, JDFBaseDataTypes.EnumFitsValue testlists, JDFElement.EnumValidationLevel level)
      Gets of jdfRoot a vector of all executable nodes (jdf root or children nodes that this Device may execute)
      Parameters:
      jdfRoot - the node we test
      testlists - testlists that are specified for the State elements (FitsValue_Allowed or FitsValue_Present)
      Will be used in fitsValue method of the State class.
      level - validation level
      Returns:
      VElement - vector of executable JDFNodes, null if none found
    • getBadJDFInfo

      public final XMLDoc getBadJDFInfo(JDFNode jdfRoot, JDFBaseDataTypes.EnumFitsValue testlists, JDFElement.EnumValidationLevel level)
      Composes a BugReport in XML form for the given JDFNode 'jdfRoot'. Gives a list of error messages for 'jdfRoot' and every child rejected Node.
      Returns null if there are no errors.
      Parameters:
      jdfRoot - the node 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 class.
      level - validation level
      Returns:
      XMLDoc - XMLDoc output of the error messages. If XMLDoc is null there are no errors.
    • getJMFInfo

      public static XMLDoc getJMFInfo(JDFJMF jmfRoot, JDFResponse knownMessagesResp, JDFBaseDataTypes.EnumFitsValue testlists, JDFElement.EnumValidationLevel level, boolean ignoreExtensions)
      Composes a BugReport in XML form for the given JMF message 'jmfRoot'. Gives a list of error messages for 'jmfRoot' and every child rejected element.
      Returns null if there are no errors.
      Parameters:
      jmfRoot - the node to test
      knownMessagesResp -
      testlists - testlists that are specified for the State elements (FitsValue_Allowed or FitsValue_Present)
      Will be used in fitsValue method of the State class.
      level - validation level
      ignoreExtensions -
      Returns:
      XMLDoc - XMLDoc output of the error messages. If XMLDoc is null there are no errors.
    • getMessageServiceForJMFType

      public static JDFMessageService getMessageServiceForJMFType(JDFMessage m, JDFResponse knownMessagesResp)
      Parameters:
      m - the message to test
      knownMessagesResp - the Response that contains the relevant devcap fo the jmf
      Returns:
      the JMFMessageService element for this message based on family and type
    • matchesType

      public boolean matchesType(JDFNode testRoot, boolean bLocal)
      test whether a given node has the corect Types and Type Attribute
      Parameters:
      testRoot - the JDF or JMF to test
      bLocal - if true, only check the root of this, else check children as well
      Returns:
      boolean - true if this DeviceCaps TypeExpression fits testRoot/@Type and testRoot/@Types
    • getMatchingTypeNodeVector

      public VElement getMatchingTypeNodeVector(JDFNode testRoot)
      test whether a given node has the corect Types and Type Attribute
      Parameters:
      testRoot - the JDF or JMF to test
      Returns:
      VElement - the list of matching JDF nodes, null if none found
    • actionPoolReport

      public static KElement actionPoolReport(IDeviceCapable devCapable, JDFElement jdfRootorMess, KElement parentReport)
      actionPoolReport - tests if the JDFNode fits Actions from ActionPool of this DeviceCap.
      Composes a detailed report of the found errors in XML form. If XMLDoc is null - there are no errors
      Parameters:
      jdfRoot - node to test
      Returns:
      KElement - KElement output of the error messages. If KElement is null there are no errors, JDFNode fits the ActionPool of this DeviceCap and will be accepted by the device.
      Throws:
      JDFException - if DeviceCap is invalid: ActionPool refers to the non-existent TestPool
      JDFException - if DeviceCap is invalid: Action refers to the non-existent Test
    • createModuleCaps

      public void createModuleCaps(String includeNameExpression)
      creates and links devcaps to modules
      Parameters:
      includeNameExpression - regexp of names to include
    • setDefaultsFromCaps

      public boolean setDefaultsFromCaps(JDFNode node, boolean bLocal, boolean bAll)
      set the defaults of node to the values defined in the child DevCap and State elements
      Parameters:
      node - the JDFNode in which to set defaults
      bLocal - if true, set only in the local node, else recurse children
      bAll - if false, only add if minOccurs>=1 and required=true or a default exists
    • getStates

      public VElement getStates()
      get all direct state elements of
      Returns:
      the vector of state elements
    • getDevCapsByName

      public JDFDevCaps getDevCapsByName(String devCapsName, JDFAutoDevCaps.EnumContext context, JDFResourceLink.EnumUsage linkUsage, JDFNode.EnumProcessUsage processUsage, int iSkip)
      get a DevCaps element by name and further restrictions. If an Enumerative restriction is null, the restriction is not checked.
      Parameters:
      devCapsName - the Name attribute of the DevCaps
      context - the Context attribute of the DevCaps
      linkUsage - the LinkUsage attribute of the DevCaps
      processUsage - the ProcessUsage attribute of the DevCaps
      iSkip - the iSkip'th matching DevCaps
      Returns:
      JDFDevCaps the matching DevCaps, null if not there
    • setCombinedMethod

      public void setCombinedMethod(JDFAutoDeviceCap.EnumCombinedMethod method)
      set attribute CombinedMethod to an individual method
      Parameters:
      method - the individual combined method to set
    • isIgnoreExtensions

      public boolean isIgnoreExtensions()
      Returns:
      the ignoreExtensions
    • setIgnoreExtensions

      public void setIgnoreExtensions(boolean _ignoreExtensions)
      Parameters:
      _ignoreExtensions - the ignoreExtensions to set
    • isIgnoreDefaults

      public boolean isIgnoreDefaults()
      Returns:
      the ignoreDefaults
    • setIgnoreDefaults

      public void setIgnoreDefaults(boolean _ignoreDefaults)
      Parameters:
      _ignoreDefaults - the ignoreDefaults to set
    • getTargetCap

      public ICapabilityElement getTargetCap(String id)
      Description copied from interface: IDeviceCapable
      get the target JDFTerm referenced by id
      Specified by:
      getTargetCap in interface IDeviceCapable
      Parameters:
      id - the @ID of the term
      Returns:
      ICapabilityElement the referenced term, null if it doesn't exist
      See Also:
    • appendBooleanState

      public JDFBooleanState appendBooleanState(String nam)
      appends a BooleanState with @Name="name"
      Parameters:
      nam - the name attribute of the newly appended BooleanState
      Returns:
      JDFBooleanState: the newly appended BooleanState
    • appendEnumerationState

      public JDFEnumerationState appendEnumerationState(String nam)
      appends a NumberState with @Name="name"
      Parameters:
      nam - the name attribute of the newly appended NumberState
      Returns:
      JDFNumberState: the newly appended NumberState
    • appendIntegerState

      public JDFIntegerState appendIntegerState(String nam)
      appends an IntegerState with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended IntegerState
      Returns:
      JDFIntegerState: the newly appended IntegerState
    • appendNameState

      public JDFNameState appendNameState(String nam)
      appends a NameState with @Name="name"
      Parameters:
      nam - the name attribute of the newly appended NameState
      Returns:
      JDFNameState: the newly appended NameState
    • appendStringState

      public JDFStringState appendStringState(String nam)
      appends a StringState with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended StringState
      Returns:
      JDFStringState: the newly appended StringState
    • getBooleanState

      public JDFBooleanState getBooleanState(String nam)
      gets an existing BooleanState with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended BooleanState
      Returns:
      JDFBooleanState: the existing BooleanState
    • getCreateBooleanState

      public JDFBooleanState getCreateBooleanState(String nam)
      gets a NumberState with @Name="name", appends it if it does not exist
      Parameters:
      nam - the name attribute of the newly appended NumberState
      Returns:
      JDFNumberState: the existing or newly appended NumberState
    • getCreateEnumerationState

      public JDFEnumerationState getCreateEnumerationState(String nam)
      gets a EnumerationState with @Name="name", appends it if it does not exist
      Parameters:
      nam - the name attribute of the newly appended EnumerationState
      Returns:
      JDFEnumerationState the existing or newly appended EnumerationState
    • getCreateIntegerState

      public JDFIntegerState getCreateIntegerState(String nam)
      gets an IntegerState with @Name="name", appends it if it does not yet exist
      Parameters:
      nam - the name attribute of the newly appended IntegerState
      Returns:
      JDFIntegerState: the existing or newly appended IntegerState
    • getCreateNameState

      public JDFNameState getCreateNameState(String nam)
      gets a NameState with @Name="name", appends it if it does not exist
      Parameters:
      nam - the name attribute of the newly appended NameState
      Returns:
      JDFNameState: the existing or newly appended NameState
    • getCreateStringState

      public JDFStringState getCreateStringState(String nam)
      gets a StringState with @Name="name", appends it if it does not yet exist
      Parameters:
      nam - the Name attribute of the newly appended StringState
      Returns:
      JDFStringState: the existing or newly appended StringState
    • getEnumerationState

      public JDFEnumerationState getEnumerationState(String nam)
      gets an existing EnumerationState with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended EnumerationState
      Returns:
      JDFEnumerationState: the existing EnumerationState
    • getIntegerState

      public JDFIntegerState getIntegerState(String nam)
      gets an existing IntegerState with @Name="name"
      Parameters:
      nam - the name attribute of the newly appended IntegerState
      Returns:
      JDFIntegerState: the existing IntegerState
    • getNameState

      public JDFNameState getNameState(String nam)
      gets an existing NameState with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended NameState
      Returns:
      JDFNameState: the existing NameState
    • getNumberState

      public JDFNumberState getNumberState(String nam)
      gets an existing NumberState with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended NumberState
      Returns:
      JDFNumberState: the existing NumberState
    • getState

      public JDFAbstractState getState(String nam)
      gets an existing State with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended StringState
      Returns:
      JDFStringState: the existing StringState
    • getStringState

      public JDFStringState getStringState(String nam)
      gets an existing StringState with @Name="name"
      Parameters:
      nam - the Name attribute of the newly appended StringState
      Returns:
      JDFStringState: the existing StringState