Package com.ibm.di.fc.emf
Class ModelParser
- java.lang.Object
-
- com.ibm.di.fc.emf.ModelParser
-
@Deprecated public class ModelParser extends java.lang.Object
Deprecated.Utility class providing a set functions related to working with the Ecore model used by EMF XMLToSDO and SDOToXML Function Components.
THIS CLASS HAS BEEN DEPRECATED SINCE THE IBM Tivoli Directory Integrator 7.0 RELEASE AND WILL BE COMPLETELY REMOVED IN A FUTURE RELEASE!
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DOCROOT_CLASSNAME
Deprecated.The name of the classes used in the Ecore models for the document root classes.static java.lang.String
ROOT_NAME
Deprecated.The name of the XML root object.static java.lang.String
XMLNSPREFIX_FEATURE_NAME
Deprecated.The name of the feature used in the Ecore models for the namespaces maps.
-
Constructor Summary
Constructors Constructor Description ModelParser(ResourceHash resHash)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkPackagesForConformity(java.util.Collection packageCollection, boolean isNamespaceAware)
Deprecated.org.eclipse.emf.ecore.sdo.EDataObject
createRootObject(java.lang.String xsdFile)
Deprecated.static org.eclipse.emf.ecore.sdo.EDataObject
createRootObject(org.eclipse.emf.ecore.EPackage epackage)
Deprecated.org.eclipse.emf.ecore.EStructuralFeature
getFeature(org.eclipse.emf.ecore.EClass eclass, java.lang.String name, java.util.Map prefixToURIMap)
Deprecated.static java.lang.String
getFeatureName(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.static java.lang.String
getFeatureNamespace(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.java.util.Collection
getPackageCollection(java.lang.String xsdFile)
Deprecated.static org.eclipse.emf.ecore.EClass
getRootClass(org.eclipse.emf.ecore.EPackage epackage)
Deprecated.static org.eclipse.emf.ecore.EPackage
getRootPackage(java.util.Collection packageCollection)
Deprecated.static int
getSeparatorPosition(java.lang.String path)
Deprecated.static boolean
isAttribute(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.static boolean
isElement(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.static boolean
isIgnored(java.lang.String name)
Deprecated.static boolean
isSeparator(char c)
Deprecated.static java.lang.String
makeFeaturePath(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String path, java.util.Map uriToPrefixMap, boolean alwaysPrefix)
Deprecated.java.util.Map
parseNamespaces(java.lang.String namespaces, boolean isPrefixToURIMap)
Deprecated.static void
updateFactoryInstances(java.util.Collection packageCollection)
Deprecated.static void
updatePackageRegistry(java.util.Collection packageCollection, org.eclipse.emf.ecore.EPackage.Registry packageRegistry)
Deprecated.
-
-
-
Field Detail
-
ROOT_NAME
public static final java.lang.String ROOT_NAME
Deprecated.The name of the XML root object. The name is used in the path expressions.- See Also:
- Constant Field Values
-
XMLNSPREFIX_FEATURE_NAME
public static final java.lang.String XMLNSPREFIX_FEATURE_NAME
Deprecated.The name of the feature used in the Ecore models for the namespaces maps.- See Also:
- Constant Field Values
-
DOCROOT_CLASSNAME
public static final java.lang.String DOCROOT_CLASSNAME
Deprecated.The name of the classes used in the Ecore models for the document root classes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModelParser
@Deprecated public ModelParser(ResourceHash resHash)
Deprecated.Initializing the class instances.
-
-
Method Detail
-
isIgnored
@Deprecated public static boolean isIgnored(java.lang.String name)
Deprecated.Checks if the specified string is a ignored feature name.
-
isSeparator
@Deprecated public static boolean isSeparator(char c)
Deprecated.Checks if the specified character is a feature path separator.
-
getFeatureName
@Deprecated public static java.lang.String getFeatureName(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.Returns the name as specified in the XML Schema of an XML element or attribute represented by thefeature
object.
-
getFeatureNamespace
@Deprecated public static java.lang.String getFeatureNamespace(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.Returns the namespace URI of the XML element or attribute represented by thefeature
object.
-
isAttribute
@Deprecated public static boolean isAttribute(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.Checks if the specifiedfeature
object represents an XML attribute.
-
isElement
@Deprecated public static boolean isElement(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.Checks if the specifiedfeature
object represents an XML element.
-
makeFeaturePath
@Deprecated public static java.lang.String makeFeaturePath(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String path, java.util.Map uriToPrefixMap, boolean alwaysPrefix)
Deprecated.Appends an XML element or attribute name to the current path. The method qualifies the name with namespace prefix if such exists in theuriToPrefixMap
parameter, or with a namespace URI if a prefix does not exist and thealwaysPrefix
parameter istrue
.- Parameters:
feature
- EStructuralFeature object that represents an XML element or attribute.path
- the path expression from the root till the current XML element or attribute.uriToPrefixMap
- namespace URI to prefix map.alwaysPrefix
- iftrue
and no prefix is defined for the namespace of the XML element or attribute, for prefix is used the namespace URI.
-
getSeparatorPosition
@Deprecated public static int getSeparatorPosition(java.lang.String path)
Deprecated.Searches for a separator in the feature path and returns the position of the first separator or -1 if there are no separators.
-
getRootPackage
@Deprecated public static org.eclipse.emf.ecore.EPackage getRootPackage(java.util.Collection packageCollection)
Deprecated.Searches the package collection for a package that defines a root class.- Parameters:
packageCollection
- collection of EPackage objects- Returns:
- a package that defines a root class
-
createRootObject
@Deprecated public static org.eclipse.emf.ecore.sdo.EDataObject createRootObject(org.eclipse.emf.ecore.EPackage epackage)
Deprecated.Creates a Data Object of type the root class of theepackage
package.- Parameters:
epackage
- specifies the package which root class is used in the object creation- Returns:
- Data Object of type the root class of the
epackage
package. If the package has no root classnull
is returned.
-
updatePackageRegistry
@Deprecated public static void updatePackageRegistry(java.util.Collection packageCollection, org.eclipse.emf.ecore.EPackage.Registry packageRegistry)
Deprecated.Traverses a collection of EPackages and adds them to a package registry.- Parameters:
packageCollection
- a collection of EPackagespackageRegistry
- a package registry
-
updateFactoryInstances
@Deprecated public static void updateFactoryInstances(java.util.Collection packageCollection)
Deprecated.Sets the factory instances of all EPackages in the collection to factory instances compliant to the EDataObject interface.- Parameters:
packageCollection
- collection of EPackage objects
-
getRootClass
@Deprecated public static org.eclipse.emf.ecore.EClass getRootClass(org.eclipse.emf.ecore.EPackage epackage)
Deprecated.Returns the root class of the specified package.
-
checkPackagesForConformity
@Deprecated public void checkPackagesForConformity(java.util.Collection packageCollection, boolean isNamespaceAware) throws java.lang.Exception
Deprecated.Checks if the packages conform to the restrictions set by the EMF XMLToSDO and SDOToXML Function Components. At this moment the only restriction checked is for case-insensitive equality in names of sibling XML elements or attributes.- Parameters:
packageCollection
- the Ecore model package collection.isNamespaceAware
- iftrue
siblings with case-insensitive equality in names but from different namespaces will be considered different.- Throws:
java.lang.Exception
- if there are siblings with case-insenstive equal names and the XML elements or attributes are in the same namespace.java.lang.Exception
- if there are siblings with case-insensitive equal names and the XML elements or attributes are in different namespaces but theisNamespaceAware
is false.
-
parseNamespaces
@Deprecated public java.util.Map parseNamespaces(java.lang.String namespaces, boolean isPrefixToURIMap) throws java.lang.Exception
Deprecated.Parses a string that describes a mapping between prefixes and namespace URIs. Then creates a prefix to URI or URI to prefix map, depending on theisPrefixToURIMap
parameter.- Parameters:
namespaces
- string object describing a mapping between prefixes and namespace URIs. Each mapping is delimited by an end-of-line character. On each line the prefix is delimited from the namespace URI by an equal sign.isPrefixToURIMap
- iftrue
the created map is prefix to URI map, otherwise it is a URI to prefix map.- Returns:
- prefix to URI map or URI to prefix map created by parsing the
namespaces
attribute. - Throws:
java.lang.Exception
- if the namespace mapping format (prefix=namespaceURI) is not obeyed.
-
getPackageCollection
@Deprecated public java.util.Collection getPackageCollection(java.lang.String xsdFile) throws java.lang.Exception
Deprecated.Reads an XML Schema file and creates an Ecore model corresponding to it. Then returns aCollection
containing all packages in the model.- Parameters:
xsdFile
- specifies the location of the XML Schema File.- Throws:
java.lang.Exception
- if the XML Schema file is not found or is not valid XML Schema.
-
createRootObject
@Deprecated public org.eclipse.emf.ecore.sdo.EDataObject createRootObject(java.lang.String xsdFile) throws java.lang.Exception
Deprecated.Creates a root object according to the XML Schema specified by thexsdFile
file.- Parameters:
xsdFile
- specifies an XML Schema file.- Returns:
- Data Object corresponding to the root object defined in the XML Schema
- Throws:
java.lang.Exception
- if the specified file does not exist or contains an invalid XML Schema.java.lang.Exception
- if the XML Schema does not define a root element
-
getFeature
@Deprecated public org.eclipse.emf.ecore.EStructuralFeature getFeature(org.eclipse.emf.ecore.EClass eclass, java.lang.String name, java.util.Map prefixToURIMap) throws java.lang.Exception
Deprecated.Searches an EClass features for a feature which represents an XML element or attribute with specified name. The function searches for a feature with matching name and namespace and if found it is returned. If only a feature with matching name is found it is also returned. If no feature matches the specified name an exception is thrown. Note: XML attributes are not considered namespace qualified, the prefix is regarded as part of the name.- Parameters:
eclass
- the EClass object which features are searched.name
- the name of the XML element or attribute, probably with namespace prefix.prefixToURIMap
- prefix to namespace URI map.- Returns:
- feature representing the XML element or attribute with the
specified name and namespace by the
name
parameter. - Throws:
java.lang.Exception
- if no feature matches the specified name.
-
-