public class DictionaryComponent extends Object implements DictionaryService, TenantDeployer
Constructor and Description |
---|
DictionaryComponent() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
Collection<QName> |
getAllAspects() |
Collection<QName> |
getAllAspects(boolean includeInherited) |
Collection<QName> |
getAllAssociations()
Get all the association definitions
|
Collection<QName> |
getAllAssociations(boolean includeInherited) |
Collection<QName> |
getAllDataTypes() |
Collection<QName> |
getAllModels() |
Collection<QName> |
getAllModels(boolean includeInherited) |
Collection<QName> |
getAllProperties(QName dataType)
Get all properties defined across all models with the given data type.
|
Collection<QName> |
getAllTypes() |
Collection<QName> |
getAllTypes(boolean includeInherited) |
TypeDefinition |
getAnonymousType(QName name)
Creates an anonymous
TypeDefinition with all the mandatory Aspects applied. |
TypeDefinition |
getAnonymousType(QName type,
Collection<QName> aspects)
Construct an anonymous type that combines the definitions of the specified
type and aspects.
|
AspectDefinition |
getAspect(QName name) |
Collection<QName> |
getAspects(QName model) |
AssociationDefinition |
getAssociation(QName associationName)
Gets the definition of the association as defined by its owning Class.
|
Collection<QName> |
getAssociations(QName model) |
ClassDefinition |
getClass(QName name) |
ConstraintDefinition |
getConstraint(QName constraintQName)
Gets the definition of the constraint
|
Collection<ConstraintDefinition> |
getConstraints(QName model)
Get constraints for the specified model
|
Collection<ConstraintDefinition> |
getConstraints(QName model,
boolean referenceableDefsOnly)
Get constraints for the specified model
Optionally return referenceable (ie.
|
DataTypeDefinition |
getDataType(Class<?> javaClass) |
DataTypeDefinition |
getDataType(QName name) |
Collection<QName> |
getDataTypes(QName model) |
String |
getMessage(String messageKey)
Get message from registered resource bundle.
|
String |
getMessage(String messageKey,
Locale locale)
Get a localised message string
|
String |
getMessage(String messageKey,
Locale locale,
Object... params)
Get a localised message string, parameterized using standard MessageFormatter.
|
String |
getMessage(String messageKey,
Object... params)
Get a localised message string, parameterized using standard MessageFormatter.
|
ModelDefinition |
getModel(QName model) |
ModelDefinition |
getModelByNamespaceUri(String uri) |
Collection<QName> |
getProperties(QName model)
Get all properties for the specified model
|
Collection<QName> |
getProperties(QName model,
QName dataType)
Get all properties defined for the given model with the given data type.
|
PropertyDefinition |
getProperty(QName propertyName)
Gets the definition of the property as defined by its owning Class.
|
PropertyDefinition |
getProperty(QName className,
QName propertyName)
Gets the definition of the property as defined by the specified Class.
|
Map<QName,PropertyDefinition> |
getPropertyDefs(QName className)
Gets the definitions of the properties defined by the specified Class.
|
Collection<QName> |
getSubAspects(QName superAspect,
boolean follow) |
Collection<QName> |
getSubTypes(QName superType,
boolean follow)
Get the sub types of the type.
|
TypeDefinition |
getType(QName name) |
Collection<QName> |
getTypes(QName model) |
void |
init() |
boolean |
isSubClass(QName className,
QName ofClassName)
Determines whether a class is a sub-class of another class
|
void |
onDisableTenant() |
void |
onEnableTenant() |
void |
setDictionaryDAO(DictionaryDAO dictionaryDAO)
Sets the Meta Model DAO
|
void |
setMessageLookup(MessageLookup messageLookup)
Sets the message lookup service
|
public void setDictionaryDAO(DictionaryDAO dictionaryDAO)
dictionaryDAO
- dictionary DAOpublic void setMessageLookup(MessageLookup messageLookup)
messageLookup
- the message lookup servicepublic Collection<QName> getAllModels()
getAllModels
in interface DictionaryService
public Collection<QName> getAllModels(boolean includeInherited)
public ModelDefinition getModel(QName model)
getModel
in interface DictionaryService
model
- the model name to retrievepublic Collection<QName> getAllDataTypes()
getAllDataTypes
in interface DictionaryService
public Collection<QName> getDataTypes(QName model)
getDataTypes
in interface DictionaryService
model
- the model to retrieve data types forpublic Collection<QName> getAllTypes()
getAllTypes
in interface DictionaryService
public Collection<QName> getAllTypes(boolean includeInherited)
getAllTypes
in interface DictionaryService
public Collection<QName> getSubTypes(QName superType, boolean follow)
DictionaryService
getSubTypes
in interface DictionaryService
superType
- the qualified name of the typefollow
- true => all sub-type descendants, false => immediate sub-type childrenpublic Collection<QName> getTypes(QName model)
getTypes
in interface DictionaryService
model
- the model to retrieve types forpublic Collection<QName> getAllAspects()
getAllAspects
in interface DictionaryService
public Collection<QName> getAllAspects(boolean includeInherited)
getAllAspects
in interface DictionaryService
public Collection<QName> getAllAssociations()
DictionaryService
getAllAssociations
in interface DictionaryService
public Collection<QName> getAllAssociations(boolean includeInherited)
getAllAssociations
in interface DictionaryService
public Collection<QName> getSubAspects(QName superAspect, boolean follow)
getSubAspects
in interface DictionaryService
superAspect
- QNamefollow
- true => follow up the super-class hierarchy, false => immediate sub aspects onlypublic Collection<QName> getAspects(QName model)
getAspects
in interface DictionaryService
model
- the model to retrieve aspects forpublic Collection<QName> getAssociations(QName model)
getAssociations
in interface DictionaryService
model
- the model to retrieve associations forpublic boolean isSubClass(QName className, QName ofClassName)
DictionaryService
isSubClass
in interface DictionaryService
className
- the sub-class to testofClassName
- the class to test againstpublic DataTypeDefinition getDataType(QName name)
getDataType
in interface DictionaryService
name
- the name of the data type to retrievepublic DataTypeDefinition getDataType(Class<?> javaClass)
getDataType
in interface DictionaryService
javaClass
- java class to find datatype forpublic TypeDefinition getType(QName name)
getType
in interface DictionaryService
name
- the name of the type to retrievepublic AspectDefinition getAspect(QName name)
getAspect
in interface DictionaryService
name
- the name of the aspect to retrievepublic ClassDefinition getClass(QName name)
getClass
in interface DictionaryService
name
- the name of the class (type or aspect) to retrievepublic TypeDefinition getAnonymousType(QName type, Collection<QName> aspects)
DictionaryService
getAnonymousType
in interface DictionaryService
type
- the type to start withaspects
- the aspects to combine with the typepublic TypeDefinition getAnonymousType(QName name)
TypeDefinition
with all the mandatory Aspects
applied.
This collapses all mandatory Aspects
into a single TypeDefinition
.getAnonymousType
in interface DictionaryService
name
- the name of the type definition.public PropertyDefinition getProperty(QName className, QName propertyName)
DictionaryService
getProperty
in interface DictionaryService
className
- the class namepropertyName
- the property namepublic Map<QName,PropertyDefinition> getPropertyDefs(QName className)
DictionaryService
getPropertyDefs
in interface DictionaryService
className
- the class namepublic PropertyDefinition getProperty(QName propertyName)
DictionaryService
getProperty
in interface DictionaryService
propertyName
- the property namepublic AssociationDefinition getAssociation(QName associationName)
DictionaryService
getAssociation
in interface DictionaryService
associationName
- the property namepublic Collection<QName> getAllProperties(QName dataType)
DictionaryService
getAllProperties
in interface DictionaryService
dataType
- QNamepublic Collection<QName> getProperties(QName model, QName dataType)
DictionaryService
getProperties
in interface DictionaryService
model
- QNamedataType
- QNamepublic Collection<QName> getProperties(QName model)
DictionaryService
getProperties
in interface DictionaryService
model
- QNamepublic ConstraintDefinition getConstraint(QName constraintQName)
DictionaryService
getConstraint
in interface DictionaryService
constraintQName
- the constraint namepublic Collection<ConstraintDefinition> getConstraints(QName model)
DictionaryService
getConstraints
in interface DictionaryService
model
- QNamepublic Collection<ConstraintDefinition> getConstraints(QName model, boolean referenceableDefsOnly)
DictionaryService
getConstraints
in interface DictionaryService
model
- QNamereferenceableDefsOnly
- booleanpublic void init()
init
in interface TenantDeployer
public void destroy()
destroy
in interface TenantDeployer
public void onEnableTenant()
onEnableTenant
in interface TenantDeployer
public void onDisableTenant()
onDisableTenant
in interface TenantDeployer
public String getMessage(String messageKey)
MessageLookup
getMessage
in interface MessageLookup
messageKey
- message keypublic String getMessage(String messageKey, Locale locale)
MessageLookup
getMessage
in interface MessageLookup
messageKey
- the message keylocale
- override the current localepublic String getMessage(String messageKey, Object... params)
MessageLookup
getMessage
in interface MessageLookup
messageKey
- message keyparams
- format parameterspublic String getMessage(String messageKey, Locale locale, Object... params)
MessageLookup
getMessage
in interface MessageLookup
messageKey
- the message keylocale
- override current localeparams
- the localised message stringpublic ModelDefinition getModelByNamespaceUri(String uri)
getModelByNamespaceUri
in interface DictionaryService
uri
- the namespace uri for search forCopyright © 2005–2017 Alfresco Software. All rights reserved.