Package wt.ixb.impl.jaxb
Class Mapping
java.lang.Object
wt.ixb.impl.jaxb.Mapping
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
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetAddCurrentElementToParentByType(String type, String prefix, String key) 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.static StringgetAddToAttributeForElement(String type, String key, String subKey) get all use_for_add attributes of link element by format type, element name.static Stringget add_to_element attribute by format type, parent element name, element name and attribute name
Supported API: true.static StringgetAddToElementNameForElement(String type, String key, String subKey) get all use_for_add attributes of link element by format type, element name.get all add_to_element and reference_to attribute to element name mapping
Supported API: true.getAllAddToParentAttributesForElement(String type, String prefix, String key) get all add to parent attributes for element
Supported API: true.get all orginal root element names which are describe elements by format type
Supported API: true.static Collection<String>getAllMappedAttributeValue(String type, String parent, String prefix, String subPrefix) get all mapped attribute values by format type, parent element name and element name.getAllMappedAttributeValueForFind(String type, String parent, String prefix, String subPrefix) get all mapped attribute values that use for find a object by format type, parent element name and element name.static Collection<String>getAllMappedElementValue(String type, String prefix) get all mapped element values by format type and parent element name.getAllRootElementNames(String type) get all orginal root element names (windchill name) by format type
Supported API: true.get all orginal root element names which are link elements by format type
Supported API: true.get all mapped root element names by format type
Supported API: true.static StringgetConnectReferenceByType(String type, String prefix, String key) get connect_reference attribute value by format type, parent element name and element name
Supported API: true.static StringgetDefaultMappedElementNameForAttributes(String type, String prefix, String key, String subKey) get default mapped element name by format type, parent element name and element name.static StringgetDefaultMappedElementNameForLinkElement(String type, String mapped) get default mapped element name by format type and mapped element name.getElementNameMapping(String type) get element name mapping (value to mapped value) by format type
Supported API: true.get element name reverse mapping (mapped value to value) by format type
Supported API: true.Get element name reverse mapping (mapped value which starts with JAXBConstants.STARTS_WITH_TAG -'startsWith' to value) by format type
Supported API: true.static StringgetIdTagName(String type) get tag name which type is ID by format type
Supported API: true.static Class<?>getJAXBClassByName(String type, String prefix, String key) get jaxb class by format type, parent element name and element name
Supported API: true.static StringgetMappedAttributeAddToParentBy(String type, String parent, String prefix, String key, String subPrefix) get mapped addd to parent by value (for set/get) by format type, parent element name, element name and attribute name
Supported API: true.static StringgetMappedAttributeForGetValue(String type, String parent, String prefix, String key, String subPrefix) get mapped attribute value (for get only) by format type, parent element name, element name and attribute name
Supported API: true.static StringgetMappedAttributeIdentifierValue(String type, String parent, String prefix, String key, String subPrefix) get mapped attribute value (for get only) by format type, parent element name, element name and attribute name
Supported API: true.static IntegergetMappedAttributeIndexValue(String type, String parent, String prefix, String key, String subPrefix) get mapped constant attribute value by format type, parent element name, element name and attribute name.getMappedAttributeRequiredAttributes(String type, String parent, String prefix, String key, String subPrefix) get mapped required attributes value (for set/get) by format type, parent element name, element name and attribute name
Supported API: true.getMappedAttributeRequiredAttributesForParent(String type, String parent, String prefix, String key, String subPrefix) get mapped required attributes for parent value (for set/get) by format type, parent element name, element name and attribute name
Supported API: true.static Stringget mapped attribute value (for set/get) by format type, parent element name, element name and attribute name
Supported API: true.static StringgetMappedConstantAttributeValue(String type, String parent, String prefix, String key, String subPrefix) get mapped constant attribute value by format type, parent element name, element name and attribute name.getMappedConstantAttributeValues(String type, String parent, String prefix, String subPrefix) get all mapped constant attribute values by format type, parent element name and element name.static StringgetMappedElementNameForTagAttribute(String type, String prefix, String key) get mapped element element_name_for_tag attribute by format type, parent element name and element name.getMappedElementParentToTageNameMap(String type, String prefix) get parent tag name to windchill tag name map by format type, parent element name and element name.getMappedElementRequiredAttributes(String type, String prefix, String key, String subKey) get mapped element required attributes by format type, parent element name and element name.static StringgetMappedElementTypeAttribute(String type, String prefix, String key) get mapped element type attribute by format type, parent element name and element name.static StringgetMappedElementTypeAttributes(String type, String prefix, String key) get mapped element type attribute by format type, parent element name and element name.static StringgetMappedElementValue(String type, String prefix, String key) get mapped element value by format type, parent element name and element name
Supported API: true.static Stringget mapped Object value by format type, parent element name, element name and attribute name
Supported API: true.static Stringget mapped Object value by format type, parent element name, element name and attribute name
Supported API: true.static StringgetMappedTagName(String type, String prefix, String key) get mapped element value by format type, parent element name and element name
Supported API: true.static StringgetNameByJAXBClass(String type, String parent, Class clazz) try to get element name by format type, parent element name and jaxb class.getNamesByJAXBClass(String type, String parent, Class clazz) try to get element names by format type, parent element name and jaxb class.get a list of element names which should be marshalled firstly by format type
Supported API: true.static StringgetRefTagName(String type) get tag name which type is IDREF by format type
Supported API: true.static StringgetRootTagName(String type) get root tag qname by format type
Supported API: true.get root tag required attributes by format type, we will use it init root element during marshall
Supported API: true.static Stringget seperator for attribute by format type, parent element name, element name and attribute name.static booleanget mapped attribute value (for set/get) by format type, parent element name, element name and attribute name
Supported API: true.static booleanisExportAllAttributes(String type) check if export all attributes even no explict mapping by format type
Supported API: true.static booleancheck if the attribute can be multiple by format type, parent element name, element name and attribute name
Supported API: true.static booleanisReuseExist(String type, String prefix, String key) check if the element is reusing exist ones by format type, parent element name and element name
Supported API: true.static booleancheck 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.static booleanisValidWNCSubElementName(String type, String tagName, String kind) check if the given kind is a valid sub element name for windchill
Supported API: true.static booleancheck if the attribute need to be appended by format type, parent element name, element name and attribute name
Supported API: true.
-
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 typetagName- describe element name (such as Property_representation in PLCS)kind- kind type- Returns:
- boolean
- Throws:
WTException- the wT exception
-
getElementNameMapping
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
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
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
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
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
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
get root tag qname by format type
Supported API: true.- Parameters:
type- format type- Returns:
- qname
- Throws:
WTException- the wT exception
-
getRootTagRequireAttributes
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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeprefix- element namekey- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- the sub prefix- Returns:
- boolean
- Throws:
WTException- the wT exception
-
isReuseExist
check if the element is reusing exist ones by format type, parent element name and element name
Supported API: true.- Parameters:
type- format typeprefix- the prefixkey- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeparent- parent element nameprefix- element namekey- attribute namesubPrefix- 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 typeprefix- the prefixkey- element namesubKey- 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 typemapped- 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 typeparent- parent element nameprefix- element namesubPrefix- 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 typeparent- parent element nameprefix- element namesubPrefix- 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 typeparent- parent element nameprefix- element namesubPrefix- 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 typeprefix- 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 typeprefix- parent element namekey- element name- Returns:
- value
- Throws:
WTException- the wT exception
-
getMappedTagName
get mapped element value by format type, parent element name and element name
Supported API: true.- Parameters:
type- format typeprefix- parent element namekey- 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 typeprefix- parent element namekey- 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 typeprefix- parent element namekey- 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 typeprefix- parent element namekey- element namesubKey- 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 typeprefix- parent element namekey- 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 typeprefix- parent element namekey- 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 typeprefix- parent element namekey- 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 typeprefix- parent element name- Returns:
- value
- Throws:
WTException- the wT exception
-
getAllRootMappedElementNames
get all mapped root element names by format type
Supported API: true.- Parameters:
type- format type- Returns:
- list
- Throws:
WTException- the wT exception
-
getAllRootElementNames
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
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
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 typekey- element namesubKey- 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 typekey- element namesubKey- the sub key- Returns:
- list
- Throws:
WTException- the wT exception
-
getAliasToElementNameMapping
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 typeprefix- parent element namekey- element name- Returns:
- class
- Throws:
WTException- the wT exception
-
getNameByJAXBClass
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 typeparent- the parentclazz- 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 typeparent- the parentclazz- the clazz- Returns:
- class
- Throws:
WTException- the wT exception
-