From 195774c489a1a671aca514b0afa88332bf9c6ee3 Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 10 Nov 2009 19:20:12 +0000 Subject: Moving SDO tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834617 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/commonj/sdo/helper/DataFactory.java | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java (limited to 'sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java') diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java new file mode 100644 index 0000000000..8507b83440 --- /dev/null +++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java @@ -0,0 +1,64 @@ +/** + * + * + * 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. + * + * + * + */ + +package commonj.sdo.helper; + +import commonj.sdo.DataObject; +import commonj.sdo.Type; +import commonj.sdo.impl.HelperProvider; + +/** + * A Factory for creating DataObjects. + * The created DataObjects are not connected to any other DataObjects. + */ +public interface DataFactory +{ + /** + * Create a DataObject of the Type specified by typeName with the given package uri. + * @param uri The uri of the Type. + * @param typeName The name of the Type. + * @return the created DataObject. + * @throws IllegalArgumentException if the uri and typeName does + * not correspond to a Type this factory can instantiate. + */ + DataObject create(String uri, String typeName); + + /** + * Create a DataObject supporting the given interface. + * InterfaceClass is the interface for the DataObject's Type. + * The DataObject created is an instance of the interfaceClass. + * @param interfaceClass is the interface for the DataObject's Type. + * @return the created DataObject. + * @throws IllegalArgumentException if the instanceClass does + * not correspond to a Type this factory can instantiate. + */ + DataObject create(Class interfaceClass); + + /** + * Create a DataObject of the Type specified. + * @param type The Type. + * @return the created DataObject. + * @throws IllegalArgumentException if the Type + * cannot be instantiaed by this factory. + */ + DataObject create(Type type); + + /** + * The default DataFactory. + */ + DataFactory INSTANCE = HelperProvider.getDataFactory(); + +} -- cgit v1.2.3