Package com.ibm.di.fc.emf
Class ModelParser
- java.lang.Object
-
- com.ibm.di.fc.emf.ModelParser
-
@Deprecated public class ModelParser extends java.lang.ObjectDeprecated.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.StringDOCROOT_CLASSNAMEDeprecated.The name of the classes used in the Ecore models for the document root classes.static java.lang.StringROOT_NAMEDeprecated.The name of the XML root object.static java.lang.StringXMLNSPREFIX_FEATURE_NAMEDeprecated.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 voidcheckPackagesForConformity(java.util.Collection packageCollection, boolean isNamespaceAware)Deprecated.org.eclipse.emf.ecore.sdo.EDataObjectcreateRootObject(java.lang.String xsdFile)Deprecated.static org.eclipse.emf.ecore.sdo.EDataObjectcreateRootObject(org.eclipse.emf.ecore.EPackage epackage)Deprecated.org.eclipse.emf.ecore.EStructuralFeaturegetFeature(org.eclipse.emf.ecore.EClass eclass, java.lang.String name, java.util.Map prefixToURIMap)Deprecated.static java.lang.StringgetFeatureName(org.eclipse.emf.ecore.EStructuralFeature feature)Deprecated.static java.lang.StringgetFeatureNamespace(org.eclipse.emf.ecore.EStructuralFeature feature)Deprecated.java.util.CollectiongetPackageCollection(java.lang.String xsdFile)Deprecated.static org.eclipse.emf.ecore.EClassgetRootClass(org.eclipse.emf.ecore.EPackage epackage)Deprecated.static org.eclipse.emf.ecore.EPackagegetRootPackage(java.util.Collection packageCollection)Deprecated.static intgetSeparatorPosition(java.lang.String path)Deprecated.static booleanisAttribute(org.eclipse.emf.ecore.EStructuralFeature feature)Deprecated.static booleanisElement(org.eclipse.emf.ecore.EStructuralFeature feature)Deprecated.static booleanisIgnored(java.lang.String name)Deprecated.static booleanisSeparator(char c)Deprecated.static java.lang.StringmakeFeaturePath(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String path, java.util.Map uriToPrefixMap, boolean alwaysPrefix)Deprecated.java.util.MapparseNamespaces(java.lang.String namespaces, boolean isPrefixToURIMap)Deprecated.static voidupdateFactoryInstances(java.util.Collection packageCollection)Deprecated.static voidupdatePackageRegistry(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 thefeatureobject.
-
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 thefeatureobject.
-
isAttribute
@Deprecated public static boolean isAttribute(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.Checks if the specifiedfeatureobject represents an XML attribute.
-
isElement
@Deprecated public static boolean isElement(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.Checks if the specifiedfeatureobject 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 theuriToPrefixMapparameter, or with a namespace URI if a prefix does not exist and thealwaysPrefixparameter 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- iftrueand 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 theepackagepackage.- Parameters:
epackage- specifies the package which root class is used in the object creation- Returns:
- Data Object of type the root class of the
epackagepackage. If the package has no root classnullis 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.ExceptionDeprecated.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- iftruesiblings 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 theisNamespaceAwareis false.
-
parseNamespaces
@Deprecated public java.util.Map parseNamespaces(java.lang.String namespaces, boolean isPrefixToURIMap) throws java.lang.ExceptionDeprecated.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 theisPrefixToURIMapparameter.- 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- iftruethe 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
namespacesattribute. - 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.ExceptionDeprecated.Reads an XML Schema file and creates an Ecore model corresponding to it. Then returns aCollectioncontaining 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.ExceptionDeprecated.Creates a root object according to the XML Schema specified by thexsdFilefile.- 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.ExceptionDeprecated.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
nameparameter. - Throws:
java.lang.Exception- if no feature matches the specified name.
-
-