public class TypeFactory
extends com.streamscape.sef.dispatcher.AbstractFabricContextFactory
Title: Structured Data Objects
Description: Defines an auxiliary factory working with Semantic Type objects.
Typical usage:
TypeFactory.addSemanticType(TypeFactory.createSemanticType("MyType", "com.test.MyType"));
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
DEFAULT_SERIAL_VERSION_ID
Constructor and Description |
---|
TypeFactory() |
Modifier and Type | Method and Description |
---|---|
static void |
addSemanticType(SemanticType semanticType)
Adds the specified Semantic Type to the environment.
|
static SemanticType |
createSemanticType(java.lang.Class typeClass)
Performs the
createSemanticType(String, Class) with the first parameter typeClass.getSimpleName() |
static SemanticType |
createSemanticType(java.lang.String typeName,
java.lang.Class typeClass)
Creates an instance of the Semantic Type with the specified name for the specified class.
|
static SemanticType |
createSemanticType(java.lang.String typeName,
java.lang.String className)
Creates an instance of the Semantic Type with the specified name for a class with the specified name.
|
static SemanticType |
createSemanticType(java.lang.String typeName,
StructuredDataObject object)
Creates an instance of the Semantic Type with the specified name for the specified object's class.
|
static boolean |
existsSemanticClass(java.lang.Class typeClass)
Checks if a Semantic Type associated with the specified class exists.
|
static boolean |
existsSemanticClass(java.lang.String className)
Checks if a Semantic Type associated with the specified class exists.
|
static boolean |
existsSemanticType(java.lang.String typeName)
Checks if the specified Semantic Type exists.
|
boolean |
hasDependencies(SemanticType type)
Checks if the specified type has dependent entities (semantic types, event prototypes etc).
|
static void |
removeSemanticType(java.lang.String typeName)
Executes the method
removeSemanticType(String, boolean)
with the false second parameter (i.e. |
static void |
removeSemanticType(java.lang.String typeName,
boolean force)
Removes a
Semantic Type with the specified name. |
static java.lang.String |
resolveSemanticType(java.lang.Class typeClass)
Returns a name of the Semantic Type type associated with the specified class.
|
static java.lang.String |
resolveSemanticType(java.lang.String className)
Returns a name of the Semantic Type type associated with the specified class.
|
getContext, getContextType, hasContext
clone, getSerialVersionUID
public static void addSemanticType(SemanticType semanticType) throws SemanticTypeFactoryException
semanticType
- the type to be added.SemanticTypeFactoryException
- if the specified type already exists or
if some error occurs in the Repository.public static void removeSemanticType(java.lang.String typeName) throws SemanticTypeFactoryException
removeSemanticType(String, boolean)
with the false
second parameter (i.e. removeSemanticType(type, false);
).typeName
- the name of the type to be removed.SemanticTypeFactoryException
- if the specified type does not exist or
if the specified type is a system type or
if some error occurs in the Repository.public static void removeSemanticType(java.lang.String typeName, boolean force) throws SemanticTypeFactoryException
Semantic Type
with the specified name.
force
parameter is set to true
the type will be removed
without checking for existence of dependencies or bound instances (e.g. event prototypes).
System semantic types cannot be removed.
typeName
- the name of the type to be removed.force
- the flag indicates if type should be removed without checking for existence of dependencies or bound instances.SemanticTypeFactoryException
- if the specified type does not exist or
if the specified type is a system type or
if some error occurs in the Repository.public static boolean existsSemanticType(java.lang.String typeName)
typeName
- the name of the type to be checked.true
if the specified semantic type exists, false
otherwise.public static boolean existsSemanticClass(java.lang.Class typeClass)
typeClass
- the class for which a check will be performed.true
if the specified semantic type exists, false
otherwise.public static boolean existsSemanticClass(java.lang.String className)
className
- the name of a class for which a check will be performed.true
if the specified semantic type exists, false
otherwise.public static java.lang.String resolveSemanticType(java.lang.Class typeClass)
typeClass
- the specified class.null
if the class has no associated semantic type.public static java.lang.String resolveSemanticType(java.lang.String className)
typeClass
- the name of specified class.null
if the class has no associated semantic type.public static SemanticType createSemanticType(java.lang.Class typeClass)
createSemanticType(String, Class)
with the first parameter typeClass.getSimpleName()
.
typeClass
- the class for which the type will be created.public static SemanticType createSemanticType(java.lang.String typeName, java.lang.String className)
typeName
- the name of the type to be created.className
- the name of the class for which the type will be created.public static SemanticType createSemanticType(java.lang.String typeName, java.lang.Class typeClass)
typeName
- the name of the type to be created.typeClass
- the class for which the type will be created.public static SemanticType createSemanticType(java.lang.String typeName, StructuredDataObject object)
typeName
- the name of the type to be created.object
- the object for which the type will be created.public boolean hasDependencies(SemanticType type)
type
- the type to be checked.true
if the specified type has dependent entities, false
otherwise.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.