public interface SemanticTypeFactory
Title: Structured Data Objects
Description: Defines a factory working with Semantic Type objects.
SemanticTypeFactory factory = RuntimeContext.getInstance().getSemanticTypeFactory(); SemanticType type = factory.createSemanticType("MyType", "com.test.MyType"); type.setDescription("My test type."); factory.addSemanticType(type);
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
addSemanticType(SemanticType semanticType)
Adds the specified Semantic Type to the environment.
|
SemanticType |
createSemanticType(java.lang.Class typeClass)
Performs the
createSemanticType(String, Class) with the first parameter typeClass.getSimpleName() |
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.
|
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.
|
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.
|
boolean |
existsSemanticClass(java.lang.Class typeClass)
Checks if a Semantic Type associated with the specified class exists.
|
boolean |
existsSemanticClass(java.lang.String className)
Checks if a Semantic Type associated with the specified class exists.
|
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).
|
void |
removeSemanticType(java.lang.String typeName)
Executes the method
removeSemanticType(String, boolean)
with the false second parameter (i.e. |
void |
removeSemanticType(java.lang.String typeName,
boolean force)
Removes a
Semantic Type with the specified name. |
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.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.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 the 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.boolean existsSemanticType(java.lang.String typeName)
typeName
- the name of the type to be checked.true
if the specified semantic type exists, false
otherwise.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.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.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.SemanticType createSemanticType(java.lang.String typeName, java.lang.String className)
This method does not add the created instance to the environment.
Use addSemanticType(com.streamscape.repository.types.SemanticType)
for that purpose.
typeName
- the name of the type to be created.className
- the name of the class for which the type will be created.SemanticType createSemanticType(java.lang.String typeName, java.lang.Class typeClass)
This method does not add the created instance to the environment.
Use addSemanticType(com.streamscape.repository.types.SemanticType)
for that purpose.
typeName
- the name of the type to be created.typeClass
- the class for which the type will be created.SemanticType createSemanticType(java.lang.String typeName, StructuredDataObject object)
This method does not add the created instance to the environment.
Use addSemanticType(com.streamscape.repository.types.SemanticType)
for that purpose.
typeName
- the name of the type to be created.object
- the object for which the type will be created.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.