Class Mapping

java.lang.Object
wt.ixb.impl.jaxb.Mapping

public class Mapping extends Object
This class provides methods which are used get mapping infomration of jaxb objects. including: jaxb package mapping, file location, schema file location, schema declaration and export file name

Supported API: true

Extendable: false
  • Method Details

    • isValidWNCSubElementName

      public static boolean isValidWNCSubElementName(String type, String tagName, String kind) throws WTException
      check if the given kind is a valid sub element name for windchill

      Supported API: true.
      Parameters:
      type - format type
      tagName - describe element name (such as Property_representation in PLCS)
      kind - kind type
      Returns:
      boolean
      Throws:
      WTException - the wT exception
    • getElementNameMapping

      public static Map<String,String> getElementNameMapping(String type) throws WTException
      get element name mapping (value to mapped value) by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      map
      Throws:
      WTException - the wT exception
    • getElementNameReverseMapping

      public static Map<String,String> getElementNameReverseMapping(String type) throws WTException
      get element name reverse mapping (mapped value to value) by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      map
      Throws:
      WTException - the wT exception
    • getElementNameReverseMappingForStartWith

      public static Map<String,String> getElementNameReverseMappingForStartWith(String type) throws WTException
      Get element name reverse mapping (mapped value which starts with JAXBConstants.STARTS_WITH_TAG -'startsWith' to value) by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      map
      Throws:
      WTException - the wT exception
    • getIdTagName

      public static String getIdTagName(String type) throws WTException
      get tag name which type is ID by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      tagName
      Throws:
      WTException - the wT exception
    • isExportAllAttributes

      public static boolean isExportAllAttributes(String type) throws WTException
      check if export all attributes even no explict mapping by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      tagName
      Throws:
      WTException - the wT exception
    • getNeedMarshallFirstTagNames

      public static Set<String> getNeedMarshallFirstTagNames(String type) throws WTException
      get a list of element names which should be marshalled firstly by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      set
      Throws:
      WTException - the wT exception
    • getRefTagName

      public static String getRefTagName(String type) throws WTException
      get tag name which type is IDREF by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      tagName
      Throws:
      WTException - the wT exception
    • getRootTagName

      public static String getRootTagName(String type) throws WTException
      get root tag qname by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      qname
      Throws:
      WTException - the wT exception
    • getRootTagRequireAttributes

      public static List<String> getRootTagRequireAttributes(String type) throws WTException
      get root tag required attributes by format type, we will use it init root element during marshall

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      set
      Throws:
      WTException - the wT exception
    • getMappedAttributeValue

      public static String getMappedAttributeValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped attribute value (for set/get) by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedAttributeRequiredAttributes

      public static List<String> getMappedAttributeRequiredAttributes(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped required attributes value (for set/get) by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedAttributeRequiredAttributesForParent

      public static List<String> getMappedAttributeRequiredAttributesForParent(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped required attributes for parent value (for set/get) by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedAttributeAddToParentBy

      public static String getMappedAttributeAddToParentBy(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped addd to parent by value (for set/get) by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • hasMappedAttributeValue

      public static boolean hasMappedAttributeValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped attribute value (for set/get) by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedAttributeForGetValue

      public static String getMappedAttributeForGetValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped attribute value (for get only) by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedAttributeIdentifierValue

      public static String getMappedAttributeIdentifierValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped attribute value (for get only) by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedRefObjectValue

      public static String getMappedRefObjectValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped Object value by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedReferenceToValue

      public static String getMappedReferenceToValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped Object value by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedConstantAttributeValue

      public static String getMappedConstantAttributeValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped constant attribute value by format type, parent element name, element name and attribute name. We can use it to define some constants for some attributes

      Supported API: true
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedAttributeIndexValue

      public static Integer getMappedAttributeIndexValue(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get mapped constant attribute value by format type, parent element name, element name and attribute name. We can use it to define some constants for some attributes

      Supported API: true
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getAllAddToParentAttributesForElement

      public static Set<String> getAllAddToParentAttributesForElement(String type, String prefix, String key) throws WTException
      get all add to parent attributes for element

      Supported API: true.
      Parameters:
      type - format type
      prefix - element name
      key - attribute name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • needAppend

      public static boolean needAppend(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      check if the attribute need to be appended by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      boolean
      Throws:
      WTException - the wT exception
    • isReuseExist

      public static boolean isReuseExist(String type, String prefix, String key) throws WTException
      check if the element is reusing exist ones by format type, parent element name and element name

      Supported API: true.
      Parameters:
      type - format type
      prefix - the prefix
      key - element name
      Returns:
      boolean
      Throws:
      WTException - the wT exception
    • getAddToElementAttribute

      public static String getAddToElementAttribute(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get add_to_element attribute by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      boolean
      Throws:
      WTException - the wT exception
    • isMultiple

      public static boolean isMultiple(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      check if the attribute can be multiple by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      boolean
      Throws:
      WTException - the wT exception
    • isUseParentObject

      public static boolean isUseParentObject(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      check if the attribute need to use root object to get describe element by format type, parent element name, element name and attribute name

      Supported API: true.
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      boolean
      Throws:
      WTException - the wT exception
    • getSeperator

      public static String getSeperator(String type, String parent, String prefix, String key, String subPrefix) throws WTException
      get seperator for attribute by format type, parent element name, element name and attribute name. It should be used with map and needAppend

      Supported API: true
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      key - attribute name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getDefaultMappedElementNameForAttributes

      public static String getDefaultMappedElementNameForAttributes(String type, String prefix, String key, String subKey) throws WTException
      get default mapped element name by format type, parent element name and element name. We will use it to store the attribute which has no explicit mapping

      Supported API: true
      Parameters:
      type - format type
      prefix - the prefix
      key - element name
      subKey - the sub key
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getDefaultMappedElementNameForLinkElement

      public static String getDefaultMappedElementNameForLinkElement(String type, String mapped) throws WTException
      get default mapped element name by format type and mapped element name. We will use it to get the attribute which has no explicit mapping for link elements only

      Supported API: true
      Parameters:
      type - format type
      mapped - mapped element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedConstantAttributeValues

      public static Map<String,String> getMappedConstantAttributeValues(String type, String parent, String prefix, String subPrefix) throws WTException
      get all mapped constant attribute values by format type, parent element name and element name. We can use it to define some constants for some attributes all the constant attributes under this element will be retrieved

      Supported API: true
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      subPrefix - the sub prefix
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getAllMappedAttributeValue

      public static Collection<String> getAllMappedAttributeValue(String type, String parent, String prefix, String subPrefix) throws WTException
      get all mapped attribute values by format type, parent element name and element name. All the attributes under this element will be retrieved

      Supported API: true
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      subPrefix - the sub prefix
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAllMappedAttributeValueForFind

      public static List<String> getAllMappedAttributeValueForFind(String type, String parent, String prefix, String subPrefix) throws WTException
      get all mapped attribute values that use for find a object by format type, parent element name and element name. All the attributes under this element will be retrieved

      Supported API: true
      Parameters:
      type - format type
      parent - parent element name
      prefix - element name
      subPrefix - the sub prefix
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAllMappedElementValue

      public static Collection<String> getAllMappedElementValue(String type, String prefix) throws WTException
      get all mapped element values by format type and parent element name. All the element under this parent element will be retrieved

      Supported API: true
      Parameters:
      type - format type
      prefix - the prefix
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getMappedElementValue

      public static String getMappedElementValue(String type, String prefix, String key) throws WTException
      get mapped element value by format type, parent element name and element name

      Supported API: true.
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedTagName

      public static String getMappedTagName(String type, String prefix, String key) throws WTException
      get mapped element value by format type, parent element name and element name

      Supported API: true.
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getAddCurrentElementToParentByType

      public static String getAddCurrentElementToParentByType(String type, String prefix, String key) throws WTException
      Fetch the value associated with the add_current_element_to_parent_by attribute for an element with name (as specified in 'key') and parent element name (as specified in 'prefix') for a specific schema.
      Note: If the add_current_element_to_parent_by contains exception it will only fetch the default add_current_element_to_parent_by attribute.

      In order to fetch all add_current_element_to_parent_by attributes, use getAllAddCurrentElementToParentByType()


      Supported API: true
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getConnectReferenceByType

      public static String getConnectReferenceByType(String type, String prefix, String key) throws WTException
      get connect_reference attribute value by format type, parent element name and element name

      Supported API: true.
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedElementRequiredAttributes

      public static List<String> getMappedElementRequiredAttributes(String type, String prefix, String key, String subKey) throws WTException
      get mapped element required attributes by format type, parent element name and element name. We use it to initial some attributes when creating a jaxb object

      Supported API: true
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      subKey - the sub key
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedElementTypeAttribute

      public static String getMappedElementTypeAttribute(String type, String prefix, String key) throws WTException
      get mapped element type attribute by format type, parent element name and element name.

      Supported API: true
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedElementTypeAttributes

      public static String getMappedElementTypeAttributes(String type, String prefix, String key) throws WTException
      get mapped element type attribute by format type, parent element name and element name.

      Supported API: true
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedElementNameForTagAttribute

      public static String getMappedElementNameForTagAttribute(String type, String prefix, String key) throws WTException
      get mapped element element_name_for_tag attribute by format type, parent element name and element name.

      Supported API: true
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getMappedElementParentToTageNameMap

      public static Map<String,String> getMappedElementParentToTageNameMap(String type, String prefix) throws WTException
      get parent tag name to windchill tag name map by format type, parent element name and element name.

      Supported API: true
      Parameters:
      type - format type
      prefix - parent element name
      Returns:
      value
      Throws:
      WTException - the wT exception
    • getAllRootMappedElementNames

      public static Set<String> getAllRootMappedElementNames(String type) throws WTException
      get all mapped root element names by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAllRootElementNames

      public static Set<String> getAllRootElementNames(String type) throws WTException
      get all orginal root element names (windchill name) by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAllRootLinkElementNames

      public static Set<String> getAllRootLinkElementNames(String type) throws WTException
      get all orginal root element names which are link elements by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAllDescribeElementNames

      public static Set<String> getAllDescribeElementNames(String type) throws WTException
      get all orginal root element names which are describe elements by format type

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAddToAttributeForElement

      public static String getAddToAttributeForElement(String type, String key, String subKey) throws WTException
      get all use_for_add attributes of link element by format type, element name. We use it to add it to parent object before marshalling

      Supported API: true
      Parameters:
      type - format type
      key - element name
      subKey - the sub key
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAddToElementNameForElement

      public static String getAddToElementNameForElement(String type, String key, String subKey) throws WTException
      get all use_for_add attributes of link element by format type, element name. We use it to add it to parent object before marshalling

      Supported API: true
      Parameters:
      type - format type
      key - element name
      subKey - the sub key
      Returns:
      list
      Throws:
      WTException - the wT exception
    • getAliasToElementNameMapping

      public static Map<String,String> getAliasToElementNameMapping(String type) throws WTException
      get all add_to_element and reference_to attribute to element name mapping

      Supported API: true.
      Parameters:
      type - format type
      Returns:
      map
      Throws:
      WTException - the wT exception
    • getJAXBClassByName

      public static Class<?> getJAXBClassByName(String type, String prefix, String key) throws WTException
      get jaxb class by format type, parent element name and element name

      Supported API: true.
      Parameters:
      type - format type
      prefix - parent element name
      key - element name
      Returns:
      class
      Throws:
      WTException - the wT exception
    • getNameByJAXBClass

      public static String getNameByJAXBClass(String type, String parent, Class clazz) throws WTException
      try to get element name by format type, parent element name and jaxb class. If more than one elements are found, we should raise an error

      Supported API: true
      Parameters:
      type - format type
      parent - the parent
      clazz - the clazz
      Returns:
      class
      Throws:
      WTException - the wT exception
    • getNamesByJAXBClass

      public static List<String> getNamesByJAXBClass(String type, String parent, Class clazz) throws WTException
      try to get element names by format type, parent element name and jaxb class.

      Supported API: true
      Parameters:
      type - format type
      parent - the parent
      clazz - the clazz
      Returns:
      class
      Throws:
      WTException - the wT exception