public interface InstantiatingScope extends Scope
InstantiatingScope
can instantiate only those objects within its scope. For example,
a Document
object is within the scope of an ObjectStore
, but is not
within the scope of a Domain
.
This interface provides methods for creating or retrieving objects when
you do not have type-specific knowledge of the objects to be instantiated. You can
create or retrieve objects by supplying just a class name and (for retrieval) an object
identifier or path.
Note: To create or retrieve known object types, use the static
Factory
methods for the specific object type.
Factory
methods are more convenient and provide type safety. The Factory
method results do
not have to be cast and programming errors on the returned type may be caught at build
time instead of runtime. The Factory
methods also avoid the inconvenience (and potential
for error) of specifying the type.
Modifier and Type | Method and Description |
---|---|
IndependentObject |
createObject(java.lang.String classIdent)
Creates a new object of the specified class.
|
IndependentObject |
createObject(java.lang.String classIdent,
Id objectId)
Creates a new object based on the specified class and ID.
|
IndependentObject |
fetchObject(java.lang.String classIdent,
Id objectId,
PropertyFilter filter)
Retrieves an object of the requested type, given a class identifier and object ID.
|
IndependentObject |
fetchObject(java.lang.String classIdent,
java.lang.String objectIdent,
PropertyFilter filter)
Retrieves an object of the requested type, given class and object identifiers.
|
IndependentObject |
getObject(java.lang.String classIdent,
Id objectId)
Retrieves an object of the requested type, given a class identifier and an object ID.
|
IndependentObject |
getObject(java.lang.String classIdent,
java.lang.String objectIdent)
Retrieves an object of the requested type, given class and object identifiers.
|
IndependentObject getObject(java.lang.String classIdent, java.lang.String objectIdent)
classIdent
- The class name of which this object will be an instance.objectIdent
- The ID, path, or name of the object to retrieve.IndependentObject getObject(java.lang.String classIdent, Id objectId)
classIdent
- The class name of which this object will be an instance.objectId
- The ID (GUID) of the object to retrieve.IndependentObject fetchObject(java.lang.String classIdent, java.lang.String objectIdent, PropertyFilter filter)
null
for the
filter
parameter, this method returns values for all non-object properties
and returns placeholders for all object-valued properties. For details, see the description
of the filter
parameter.classIdent
- The class name of which this object will be an instance.objectIdent
- The ID, path, or name of the object to retrieve.filter
- A PropertyFilter
object that represents information for
controlling which property values (and with what level of detail and recursion) to return.
If null
, this method returns values for all non-object properties and returns
placeholders for all object-valued properties (PropertyEngineObject
properties with a state of PropertyState.UNEVALUATED
or
PropertyState.REFERENCE
); any subsequent attempts to access an object-valued
property will cause an automatic round-trip to the server to fetch its value.IndependentObject fetchObject(java.lang.String classIdent, Id objectId, PropertyFilter filter)
null
for the
filter
parameter, this method returns values for all non-object properties
and returns placeholders for all object-valued properties. For details, see the description
of the filter
parameter.classIdent
- The class name of which this object will be an instance.objectId
- The ID (GUID) of the object to retrieve.filter
- A PropertyFilter
object that represents information for
controlling which property values (and with what level of detail and recursion) to return.
If null
, this method returns values for all non-object properties and returns
placeholders for all object-valued properties (PropertyEngineObject
properties with a state of PropertyState.UNEVALUATED
or
PropertyState.REFERENCE
); any subsequent attempts to access an object-valued
property will cause an automatic round-trip to the server to fetch its value.IndependentObject createObject(java.lang.String classIdent)
classIdent
- The class name of which this object will be an instance.IndependentObject createObject(java.lang.String classIdent, Id objectId)
classIdent
- The class name of which this object will be an instance.objectId
- The ID (GUID) to assign to the new object.© Copyright IBM Corporation 2006, 2015. All rights reserved.