com.ibm.di.fc.emf
Class ModelParser

java.lang.Object
  extended by com.ibm.di.fc.emf.ModelParser

Deprecated.

@Deprecated
public class ModelParser
extends Object

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
static String DOCROOT_CLASSNAME
          Deprecated. The name of the classes used in the Ecore models for the document root classes.
static String ROOT_NAME
          Deprecated. The name of the XML root object.
static String XMLNSPREFIX_FEATURE_NAME
          Deprecated. The name of the feature used in the Ecore models for the namespaces maps.
 
Constructor Summary
ModelParser(ResourceHash resHash)
          Deprecated. 
 
Method Summary
 void checkPackagesForConformity(Collection packageCollection, boolean isNamespaceAware)
          Deprecated. 
static org.eclipse.emf.ecore.sdo.EDataObject createRootObject(org.eclipse.emf.ecore.EPackage epackage)
          Deprecated. 
 org.eclipse.emf.ecore.sdo.EDataObject createRootObject(String xsdFile)
          Deprecated. 
 org.eclipse.emf.ecore.EStructuralFeature getFeature(org.eclipse.emf.ecore.EClass eclass, String name, Map prefixToURIMap)
          Deprecated. 
static String getFeatureName(org.eclipse.emf.ecore.EStructuralFeature feature)
          Deprecated. 
static String getFeatureNamespace(org.eclipse.emf.ecore.EStructuralFeature feature)
          Deprecated. 
 Collection getPackageCollection(String xsdFile)
          Deprecated. 
static org.eclipse.emf.ecore.EClass getRootClass(org.eclipse.emf.ecore.EPackage epackage)
          Deprecated. 
static org.eclipse.emf.ecore.EPackage getRootPackage(Collection packageCollection)
          Deprecated. 
static int getSeparatorPosition(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(String name)
          Deprecated. 
static boolean isSeparator(char c)
          Deprecated. 
static String makeFeaturePath(org.eclipse.emf.ecore.EStructuralFeature feature, String path, Map uriToPrefixMap, boolean alwaysPrefix)
          Deprecated. 
 Map parseNamespaces(String namespaces, boolean isPrefixToURIMap)
          Deprecated. 
static void updateFactoryInstances(Collection packageCollection)
          Deprecated. 
static void updatePackageRegistry(Collection packageCollection, org.eclipse.emf.ecore.EPackage.Registry packageRegistry)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_NAME

public static final 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 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 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(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 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 the feature object.


getFeatureNamespace

@Deprecated
public static String getFeatureNamespace(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated. 

Returns the namespace URI of the XML element or attribute represented by the feature object.


isAttribute

@Deprecated
public static boolean isAttribute(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated. 

Checks if the specified feature object represents an XML attribute.


isElement

@Deprecated
public static boolean isElement(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated. 

Checks if the specified feature object represents an XML element.


makeFeaturePath

@Deprecated
public static String makeFeaturePath(org.eclipse.emf.ecore.EStructuralFeature feature,
                                                String path,
                                                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 the uriToPrefixMap parameter, or with a namespace URI if a prefix does not exist and the alwaysPrefix parameter is true.

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 - if true 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(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(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 the epackage 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 class null is returned.

updatePackageRegistry

@Deprecated
public static void updatePackageRegistry(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 EPackages
packageRegistry - a package registry

updateFactoryInstances

@Deprecated
public static void updateFactoryInstances(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(Collection packageCollection,
                                                  boolean isNamespaceAware)
                                throws 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 - if true siblings with case-insensitive equality in names but from different namespaces will be considered different.
Throws:
Exception - if there are siblings with case-insenstive equal names and the XML elements or attributes are in the same namespace.
Exception - if there are siblings with case-insensitive equal names and the XML elements or attributes are in different namespaces but the isNamespaceAware is false.

parseNamespaces

@Deprecated
public Map parseNamespaces(String namespaces,
                                      boolean isPrefixToURIMap)
                    throws 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 the isPrefixToURIMap 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 - if true 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:
Exception - if the namespace mapping format (prefix=namespaceURI) is not obeyed.

getPackageCollection

@Deprecated
public Collection getPackageCollection(String xsdFile)
                                throws Exception
Deprecated. 

Reads an XML Schema file and creates an Ecore model corresponding to it. Then returns a Collection containing all packages in the model.

Parameters:
xsdFile - specifies the location of the XML Schema File.
Throws:
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(String xsdFile)
                                                       throws Exception
Deprecated. 

Creates a root object according to the XML Schema specified by the xsdFile file.

Parameters:
xsdFile - specifies an XML Schema file.
Returns:
Data Object corresponding to the root object defined in the XML Schema
Throws:
Exception - if the specified file does not exist or contains an invalid XML Schema.
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,
                                                                      String name,
                                                                      Map prefixToURIMap)
                                                    throws 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:
Exception - if no feature matches the specified name.