org.apache.tuscany.sdo.helper
Class TypeHelperImpl

java.lang.Object
  extended by org.apache.tuscany.sdo.helper.TypeHelperImpl
All Implemented Interfaces:
TypeHelper

public class TypeHelperImpl
extends Object
implements TypeHelper

Look up a Type given the uri and typeName or interfaceClass. SDO Types are available through the getType("commonj.sdo", typeName) method. Defines Types from DataObjects.


Field Summary
protected static Set builtInModels
           
protected  HelperContext helperContext
           
static String TUSCANY_NO_URI
           
 
Fields inherited from interface commonj.sdo.helper.TypeHelper
INSTANCE
 
Constructor Summary
TypeHelperImpl(HelperContext hc)
           
 
Method Summary
protected  void addPropertyInstanceProperties(Property definedProperty, DataObject modeledProperty)
           
protected  void addTypeInstanceProperties(Type definedType, DataObject modeledType)
           
 Type define(DataObject type)
          Define the DataObject as a Type.
 List define(List types)
          Define the list of DataObjects as Types.
 Property defineOpenContentProperty(String uri, DataObject property)
          Define the DataObject as a Property for setting open content.
static Set getBuiltInModels()
           
protected  Property getDefinedProperty(Property modeledProperty)
           
protected  Type getDefinedType(Type modeledType)
           
 org.eclipse.emf.ecore.util.ExtendedMetaData getExtendedMetaData()
           
 HelperContext getHelperContext()
           
 Property getOpenContentProperty(String uri, String propertyName)
          Get the open content (global) Property with the specified uri and name, or null if not found.
 Type getType(Class interfaceClass)
          Return the Type for this interfaceClass or null if not found.
 Type getType(String uri, String typeName)
          Return the Type specified by typeName with the given uri, or null if not found.
protected  void initializeProperty(Property newProperty, Property modeledProperty)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helperContext

protected HelperContext helperContext

builtInModels

protected static Set builtInModels

TUSCANY_NO_URI

public static final String TUSCANY_NO_URI
See Also:
Constant Field Values
Constructor Detail

TypeHelperImpl

public TypeHelperImpl(HelperContext hc)
Method Detail

getBuiltInModels

public static Set getBuiltInModels()

getExtendedMetaData

public org.eclipse.emf.ecore.util.ExtendedMetaData getExtendedMetaData()

getType

public Type getType(String uri,
                    String typeName)
Description copied from interface: TypeHelper
Return the Type specified by typeName with the given uri, or null if not found.

Specified by:
getType in interface TypeHelper
Parameters:
uri - The uri of the Type - type.getURI();
typeName - The name of the Type - type.getName();
Returns:
the Type specified by typeName with the given uri, or null if not found.

getType

public Type getType(Class interfaceClass)
Description copied from interface: TypeHelper
Return the Type for this interfaceClass or null if not found.

Specified by:
getType in interface TypeHelper
Parameters:
interfaceClass - is the interface for the DataObject's Type - type.getInstanceClass();
Returns:
the Type for this interfaceClass or null if not found.

define

public Type define(DataObject type)
Description copied from interface: TypeHelper
Define the DataObject as a Type. The Type is available through TypeHelper and DataGraph getType() methods.

Specified by:
define in interface TypeHelper
Parameters:
type - the DataObject representing the Type.
Returns:
the defined Type.

addTypeInstanceProperties

protected void addTypeInstanceProperties(Type definedType,
                                         DataObject modeledType)

addPropertyInstanceProperties

protected void addPropertyInstanceProperties(Property definedProperty,
                                             DataObject modeledProperty)

define

public List define(List types)
Description copied from interface: TypeHelper
Define the list of DataObjects as Types. The Types are available through TypeHelper and DataGraph getType() methods.

Specified by:
define in interface TypeHelper
Parameters:
types - a List of DataObjects representing the Types.
Returns:
the defined Types.

getDefinedType

protected Type getDefinedType(Type modeledType)

getDefinedProperty

protected Property getDefinedProperty(Property modeledProperty)

initializeProperty

protected void initializeProperty(Property newProperty,
                                  Property modeledProperty)

defineOpenContentProperty

public Property defineOpenContentProperty(String uri,
                                          DataObject property)
Description copied from interface: TypeHelper
Define the DataObject as a Property for setting open content. The containing Type of the open content property is not specified by SDO. If the specified uri is not null the defined property is accessible through TypeHelper.getOpenContentProperty(uri, propertyName). If a null uri is specified, the location and management of the open content property is not specified by SDO.

Specified by:
defineOpenContentProperty in interface TypeHelper
Parameters:
uri - the namespace URI of the open content Property or null.
Returns:
the defined open content Property.

getOpenContentProperty

public Property getOpenContentProperty(String uri,
                                       String propertyName)
Description copied from interface: TypeHelper
Get the open content (global) Property with the specified uri and name, or null if not found.

Specified by:
getOpenContentProperty in interface TypeHelper
Parameters:
uri - the namespace URI of the open content Property.
propertyName - the name of the open content Property.
Returns:
the global Property.

getHelperContext

public HelperContext getHelperContext()


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.