Class JDFAbstractState

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
org.cip4.jdflib.core.KElement
org.cip4.jdflib.core.JDFElement
org.cip4.jdflib.resource.devicecapability.JDFAbstractState
All Implemented Interfaces:
Serializable, Cloneable, JDFBaseDataTypes, ICapabilityElement, IStreamWriter, Element, ElementTraversal, EventTarget, Node, NodeList, TypeInfo
Direct Known Subclasses:
JDFBooleanState, JDFDateTimeState, JDFDurationState, JDFEnumerationState, JDFIntegerState, JDFMatrixState, JDFNameState, JDFNumberState, JDFPDFPathState, JDFRectangleState, JDFShapeState, JDFStringState, JDFXYPairState

public abstract class JDFAbstractState extends JDFElement implements JDFBaseDataTypes, ICapabilityElement
See Also:
  • Constructor Details

    • JDFAbstractState

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

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

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

    • getTheAttributeInfo

      protected AttributeInfo getTheAttributeInfo()
      Overrides:
      getTheAttributeInfo in class JDFElement
      Returns:
    • getTheElementInfo

      protected ElementInfo getTheElementInfo()
      Overrides:
      getTheElementInfo in class JDFElement
      Returns:
      the elementinfo
    • addValue

      public abstract void addValue(String value, JDFBaseDataTypes.EnumFitsValue testlists)
      add a value to the list of values defined by testlists
      Parameters:
      value - value to test
      testlists - switches between Allowed test lists and Present test lists. Has two values: Allowed and Present.
    • fitsValue

      public abstract boolean fitsValue(String value, JDFBaseDataTypes.EnumFitsValue testlists)
      Tests whether the defined value matches the Allowed test lists or the Present test lists specified for this state
      Parameters:
      value - value to test
      testlists - switches between Allowed test lists and Present test lists. Has two values: Allowed and Present.
      Returns:
      boolean - true, if the value matches the test lists or if Allowed testlists are not specified
    • getNamePath

      public final String getNamePath()
      Gets the NamePath of this State in form " DevCapsName[Context=aaa, LinkUsage=ccc]/DevCapName1/DevCapName2../@StateName "

      default getNamePath(false)

      Returns:
      String - NamePath of this State
    • getNamePathVector

      public final VString getNamePathVector()
      Specified by:
      getNamePathVector in interface ICapabilityElement
      Returns:
      See Also:
    • getNamePathVector

      public final VString getNamePathVector(boolean bRecurse)
      Gets the NamePath of this State in form " DevCapsName[Context=aaa, LinkUsage=ccc]/DevCapName1/DevCapName2../@StateName "

      default getNamePath(false)

      Parameters:
      bRecurse - if true returns " DevCapsName/SubelemName1/SubelemName2/../@StateName "
      Returns:
      String - NamePath of this State
    • getParentDevCaps

      public JDFDevCaps getParentDevCaps()
      get the ancestor devCaps, null if this resides in a DevCapPool
      Returns:
      JDFDevCaps
    • setAvailability

      public void setAvailability(JDFDeviceCap.EnumAvailability value)
      Sets attribute Availability
      Specified by:
      setAvailability in interface ICapabilityElement
      Parameters:
      value - the value to set the attribute to
    • getAvailability

      public JDFDeviceCap.EnumAvailability getAvailability()
      Gets typesafe enumerated attribute Availability
      Specified by:
      getAvailability in interface ICapabilityElement
      Returns:
      EnumAvailability: the enumeration value of the attribute
    • getParentDevCap

      public JDFDevCap getParentDevCap()
      get the parent devCap of this
      Returns:
    • setDevNS

      public void setDevNS(String value)
      Sets attribute DevNS
      Parameters:
      value - the value to set the attribute to
    • getDevNS

      public String getDevNS()
      Gets URI attribute DevNS
      Returns:
      String: the attribute value
    • setHasDefault

      public void setHasDefault(boolean value)
      Sets attribute HasDefault, default=true
      Parameters:
      value - the value to set the attribute to
    • getHasDefault

      public boolean getHasDefault()
      Gets boolean attribute HasDefault
      Returns:
      boolean: the attribute value
    • setMaxOccurs

      public void setMaxOccurs(int value)
      Sets attribute MaxOccurs,
      Parameters:
      value - the value to set the attribute to
    • getMaxOccurs

      public int getMaxOccurs()
      Gets integer attribute MaxOccurs
      Returns:
      int: the attribute value
    • setMinOccurs

      public void setMinOccurs(int value)
      Sets attribute MinOccurs, default=1
      Parameters:
      value - the value to set the attribute to
    • getMinOccurs

      public int getMinOccurs()
      Get integer attribute MinOccurs
      Returns:
      int: the attribute value
    • setName

      public void setName(String value)
      Sets String attribute Name
      Since name is independent of the data type of the State element, the setter is defined here
      Parameters:
      value - the value to set the attribute to
    • getName

      public String getName()
      Gets String attribute Name
      Since name is independent of the data type of the State element,the getter is defined here
      Returns:
      String: the attribute value
    • setRequired

      public void setRequired(boolean value)
      Sets attribute Required
      Parameters:
      value - the value to set the attribute to
    • getRequired

      public boolean getRequired()
      Gets boolean attribute Required
      Returns:
      boolean: the attribute value
    • setListType

      public void setListType(JDFAutoBasicPreflightTest.EnumListType value)
      Sets attribute ListType, default=SingleValue
      Parameters:
      value - the value to set the attribute to
    • getListType

      Gets typesafe enumerated attribute ListType
      Returns:
      EnumListType: the enumeration value of the attribute
    • setActionRefs

      public void setActionRefs(VString value)
      Sets attribute ActionRefs
      Parameters:
      value - vector of ActionRefs
    • getActionRefs

      public VString getActionRefs()
      Gets NMTOKENS attribute ActionRefs
      Returns:
      VString: the attribute value
    • setEditable

      public void setEditable(boolean value)
      Sets attribute Editable
      Parameters:
      value - the value to set the attribute to
    • getEditable

      public boolean getEditable()
      Gets boolean attribute Editable
      Returns:
      boolean: the attribute value
    • setMacroRefs

      public void setMacroRefs(VString value)
      Sets attribute MacroRefs
      Parameters:
      value - vector of MacroRefs
    • getMacroRefs

      public VString getMacroRefs()
      Get NMTOKENS attribute MacroRefs
      Returns:
      VString: the attribute value
    • setDependentMacroRef

      public void setDependentMacroRef(String value)
      Sets attribute DependentMacroRef
      Parameters:
      value - vector of DependentMacroRef
    • getDependentMacroRef

      public String getDependentMacroRef()
      Get string attribute DependentMacroRef
      Returns:
      String: the attribute value
    • setUserDisplay

      public void setUserDisplay(JDFAbstractState.EnumUserDisplay value)
      Sets attribute UserDisplay, default=Display
      Parameters:
      value - the value to set the attribute to
    • getUserDisplay

      public JDFAbstractState.EnumUserDisplay getUserDisplay()
      Gets typesafe enumerated attribute UserDisplay
      Returns:
      EnumUserDisplay: the enumeration value of the attribute
    • getCreateLoc

      public JDFLoc getCreateLoc(int iSkip)
      Gets the iSkip-th element Loc. If doesn't exist, it is created.

      default: getCreateLoc(0)

      Parameters:
      iSkip - number of elements to skip
      Returns:
      JDFLoc: the matching element
    • getLoc

      public JDFLoc getLoc(int iSkip)
      Gets the iSkip-th element Loc

      default: getCreateLoc(0)

      Parameters:
      iSkip - number of elements to skip
      Returns:
      JDFLoc: the matching element
    • appendLoc

      public JDFLoc appendLoc()
      Appends element Loc to the end of this
      Returns:
      JDFLoc: newly created Loc element
    • setAllowedLength

      protected void setAllowedLength(JDFIntegerRange value)
      set attribute AllowedLength
      Parameters:
      value - the value to set the attribute to
    • getAllowedLength

      protected JDFIntegerRange getAllowedLength()
      get attribute AllowedLength
      Returns:
      JDFIntegerRange: the attribute value
    • setPresentLength

      protected void setPresentLength(JDFIntegerRange value)
    • getPresentLength

      protected JDFIntegerRange getPresentLength()
    • fitsLength

      protected final boolean fitsLength(String str, JDFBaseDataTypes.EnumFitsValue length)
      fitsLength - tests, if the defined String str matches AllowedLength or the PresentLength, specified for this State
      Parameters:
      str - string to test
      length - switches between AllowedLength and PresentLength.
      Returns:
      boolean - true, if 'str' matches Length or if AllowedLength is not specified
    • getMatchingObjectInNode

      public Object getMatchingObjectInNode(KElement element)
      gets the matching Attribute value String or AbstractSpan object from the parent, depending on the type of the state
      Parameters:
      element - the parent in which to search
      Returns:
      Object: either a String or AbstractSpan
    • setDefaultsFromCaps

      public boolean setDefaultsFromCaps(KElement element, boolean bAll)
      set the default values specified in this in element
      Parameters:
      element - the element to set the defaults on
      bAll -
      Returns:
      true if successful
    • fitsListType

      protected final boolean fitsListType(String value)
      fitsListType - tests, if the defined value matches value of ListType attribute, specified for this State
      Parameters:
      value - value to test
      Returns:
      boolean - true, if 'value' matches specified ListType
    • getInvalidAttributesImpl

      protected VString getInvalidAttributesImpl(JDFElement.EnumValidationLevel level, boolean bIgnorePrivate, int nMax)
    • getValueLocLoc

      public JDFLoc getValueLocLoc(int iSkip, int jSkip)
      Gets the j-th element Loc of the i-th element Value
      Parameters:
      iSkip - number of Value elements to skip (iSkip=0 - first Value element)
      jSkip - number of Loc subelements of i-th Value element to skip, (jSkip=0 - first Loc element)
      Returns:
      JDFLoc: the matching Loc element
    • getValueLoc

      public final JDFValueLoc getValueLoc(int iSkip)
      get iSkip'th element Loc
      Parameters:
      iSkip - number of Value elements to skip (iSkip=0 - get first element)
      Returns:
      JDFValueLoc: the element
    • appendValueLocLoc

      public JDFLoc appendValueLocLoc(int iSkip)
      appends element Loc to the end of the i-th subelement Value
      Parameters:
      iSkip - number of Value elements to skip (iSkip=0 - first Value element)
      Returns:
      JDFLoc: newly created Loc element
    • appendValueLoc

      public final JDFValueLoc appendValueLoc()
      Appends element ValueLoc
      Returns:
      JDFLoc: newly created ValueLoc element
    • fitsRegExp

      protected final boolean fitsRegExp(String str, JDFBaseDataTypes.EnumFitsValue regexp)
      fitsRegExp - checks whether str matches the AllowedRegExp/PresentRegExp specified for this State
      Parameters:
      str - string to test
      regexp - switches between AllowedRegExp and PresentRegExp.
      Returns:
      boolean - true, if str matches the RegExp or if AllowedRegExp is not specified
    • getPresentRegExp

      protected String getPresentRegExp()
      Returns:
    • getAllowedRegExp

      protected String getAllowedRegExp()
      Returns:
    • getModuleAvailability

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

      public JDFModulePool getModulePool()
      Description copied from interface: ICapabilityElement
      get the ModulePool that contains ModuleCap elements referenced by this
      Specified by:
      getModulePool in interface ICapabilityElement
      Returns:
      See Also:
    • getCreateModulePool

      public JDFModulePool getCreateModulePool()
      Description copied from interface: ICapabilityElement
      get the ModulePool that contains ModuleCap elements referenced by this create one, if it does not exist
      Specified by:
      getCreateModulePool in interface ICapabilityElement
      Returns:
      See Also:
    • getModuleRefs

      public VString getModuleRefs()
      (21) get VString attribute ModuleRefs
      Specified by:
      getModuleRefs in interface ICapabilityElement
      Returns:
      VString the value of the attribute
    • 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
      Parameters:
      id -
      Returns:
      See Also:
    • init

      public boolean init()
      Description copied from class: KElement
      Method init. Superclass of all inits
      Overrides:
      init in class JDFElement
      Returns:
      See Also:
    • getIDPrefix

      protected String getIDPrefix()
      Description copied from class: KElement
      getIDPrefix
      Overrides:
      getIDPrefix in class KElement
      Returns:
      the default ID prefix of non-overwritten JDF elements
    • getEvaluationType

      public abstract 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:
      See Also: