org.plasma.sdo.helper
Class PlasmaTypeHelper

java.lang.Object
  extended by org.plasma.sdo.helper.PlasmaTypeHelper
All Implemented Interfaces:
TypeHelper

public class PlasmaTypeHelper
extends Object
implements TypeHelper

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


Field Summary
static PlasmaTypeHelper INSTANCE
           
 
Method Summary
 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.
 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.
 List<Type> getTypes(String uri)
          Return the Type instances specified by the given uri.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static PlasmaTypeHelper INSTANCE
Method Detail

define

public Type define(DataObject type)
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.
Throws:
IllegalArgumentException - if the Type could not be defined.

define

public List define(List types)
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.
Throws:
IllegalArgumentException - if the Types could not be defined.

defineOpenContentProperty

public Property defineOpenContentProperty(String uri,
                                          DataObject property)
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.
Throws:
IllegalArgumentException - if the Property could not be defined.

getOpenContentProperty

public Property getOpenContentProperty(String uri,
                                       String propertyName)
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.

getType

public Type getType(String uri,
                    String typeName)
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)
Return the Type for this interfaceClass or null if not found. The interfaceClass is the Java interface that follows the SDO code generation pattern.

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.
Throws:
IllegalAccessException
IllegalArgumentException

getTypes

public List<Type> getTypes(String uri)
Return the Type instances specified by the given uri.

Parameters:
uri - The namespace uri;
Returns:
the Type instances specified by the given uri.


Copyright © 2013. All rights reserved.