diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-10 19:18:51 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-10 19:18:51 +0000 |
commit | 9833a542bb75c2008c71809e4fdfebc41e67fb46 (patch) | |
tree | d89597c3f9308f70cd89c2e8e2cf4b9adeb43994 /sdo-java/trunk/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java | |
parent | 5b2262864f55b51575f381a823ffacf6b7c27a74 (diff) |
Move the SDO folder as new trunk for SDO sub project
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834610 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sdo-java/trunk/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java')
-rw-r--r-- | sdo-java/trunk/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/sdo-java/trunk/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java b/sdo-java/trunk/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java new file mode 100644 index 0000000000..6281a257b1 --- /dev/null +++ b/sdo-java/trunk/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java @@ -0,0 +1,96 @@ +/** + * <copyright> + * + * Service Data Objects + * Version 2.1.0 + * Licensed Materials + * + * (c) Copyright BEA Systems, Inc., International Business Machines Corporation, + * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG., + * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies, + * 2005, 2006. All rights reserved. + * + * </copyright> + * + */ + +package commonj.sdo.helper; + +import java.util.List; + +import commonj.sdo.DataObject; +import commonj.sdo.Property; +import commonj.sdo.Type; +import commonj.sdo.impl.HelperProvider; + +/** + * 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. + */ +public interface TypeHelper +{ + /** + * Return the Type specified by typeName with the given uri, + * or null if not found. + * @param uri The uri of the Type - type.getURI(); + * @param typeName The name of the Type - type.getName(); + * @return the Type specified by typeName with the given uri, + * or null if not found. + */ + Type getType(String uri, String typeName); + + /** + * Return the Type for this interfaceClass or null if not found. + * @param interfaceClass is the interface for the DataObject's Type - + * type.getInstanceClass(); + * @return the Type for this interfaceClass or null if not found. + */ + Type getType(Class interfaceClass); + + /** + * Get the open content (global) Property with the specified uri and name, or null + * if not found. + * @param uri the namespace URI of the open content Property. + * @param propertyName the name of the open content Property. + * @return the global Property. + */ + Property getOpenContentProperty(String uri, String propertyName); + + /** + * Define the DataObject as a Type. + * The Type is available through TypeHelper and DataGraph getType() methods. + * @param type the DataObject representing the Type. + * @return the defined Type. + * @throws IllegalArgumentException if the Type could not be defined. + */ + Type define(DataObject type); + + /** + * Define the list of DataObjects as Types. + * The Types are available through TypeHelper and DataGraph getType() methods. + * @param types a List of DataObjects representing the Types. + * @return the defined Types. + * @throws IllegalArgumentException if the Types could not be defined. + */ + List /*Type*/ define(List /*DataObject*/ types); + + /** + * 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. + * @param uri the namespace URI of the open content Property or null. + * @return the defined open content Property. + * @throws IllegalArgumentException if the Property could not be defined. + */ + Property defineOpenContentProperty(String uri, DataObject property); + + /** + * The default TypeHelper. + */ + TypeHelper INSTANCE = HelperProvider.getTypeHelper(); +} |