|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VariableRegistry
An interface to variable registries.
Method Summary | |
---|---|
void |
clearAllTypes()
Clears registered attributes of all variable types. |
Introspector |
createIntrospector()
Creates a variable introspector for this registry. |
Variable |
createVariable(String type)
Creates a new variable instance of the specified type. |
Class<?> |
defineVariableClass(String className,
Class<?>... ifaces)
Defines a new variable of the named class. |
Class<?> |
defineVariableClass(String className,
Class<?> superClass,
Class<?>... ifaces)
Defines a new variable of the named class extending the specified super class. |
Collection<? extends VariableAttributeInfo> |
getAttributeInfo(String type)
Gets the registered attributes of the specified variable type. |
VariableAttributeInfo |
getAttributeInfo(String type,
String name)
Gets the registered named attribute of the specified variable type. |
List<VariableAttributeInfo> |
getAttributeList(String type)
Gets the registered attribute list of cloned and modifiable attributes of the specified variable type. |
VariableAttributeInfo |
getAttributeNode(VariableAttributeInfo info,
String... pattern)
Gets a non-recursive attribute info node. |
List<VariableAttributeInfo> |
getAttributeTree(VariableAttributeInfo info,
String... pattern)
Gets a tree of recursive attribute infos, the original one at the index 0 and the non-recursive one at the last index. |
String |
getDefaultBaseClassName()
Gets the default base class name applied to defined variable classes. |
String |
getDefaultVariableClassName()
Gets the default variable class name applied to virtual variable types. |
VariableInfo |
getVariableInfo(String type)
Gets the registered variable info of the specified variable type. |
boolean |
isLocalizedVariables()
Checks whether variables in this registry are localized. |
boolean |
isTypeRegistered(String type)
Checks whether the specified variable type is registered. |
void |
removeAttributeInfo(String type)
Removes registered attributes of the specified variable type. |
void |
setAttributeInfo(String className)
Sets the registered attributes of the named variable class. |
void |
setAttributeInfo(String type,
Collection<? extends VariableAttributeInfo> attributes)
Sets the registered attributes of the specified variable type. |
void |
setAttributeInfo(String type,
Collection<? extends VariableAttributeInfo> attributes,
Descriptor descriptor)
Sets the registered attributes and descriptor of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
Collection<? extends VariableAttributeInfo> attributes)
Sets the registered attributes and class name of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
Collection<? extends VariableAttributeInfo> attributes,
Descriptor descriptor)
Sets the registered attributes, class name and descriptor of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
String description,
Collection<? extends VariableAttributeInfo> attributes)
Sets the registered attributes, class name and description of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
String description,
Collection<? extends VariableAttributeInfo> attributes,
Descriptor descriptor)
Sets the registered attributes, class name, description and descriptor of the specified variable type. |
void |
setDefaultBaseClassName(String className)
Sets the default base class name applied to defined variable classes. |
void |
setDefaultVariableClassName(String className)
Sets the default variable class name applied to virtual variable types. |
void |
setLocalizedVariables(boolean flag)
Sets whether variables in this registry are localized. |
void |
setVariableInfo(String type,
VariableInfo info)
Sets the registered variable info of the specified variable type. |
Set<String> |
typeSet()
Returns a read-only set of registered variable types. |
Set<String> |
typeSet(String prefix)
Returns a set of registered variable types with the given prefix. |
Methods inherited from interface org.norther.tammi.core.base.ObjectFactory |
---|
getInstance, getInstance, getInstance, getInstance, isLoaderSupported |
Methods inherited from interface org.norther.tammi.core.base.Loader |
---|
addURL, defineClass, defineSubclass, defineSubclass, getResource, getResourceAsStream, getResources, getURLs, isClassDefined, loadClass |
Method Detail |
---|
String getDefaultBaseClassName()
void setDefaultBaseClassName(String className)
className
- the default base class name.String getDefaultVariableClassName()
void setDefaultVariableClassName(String className)
className
- the default variable class name.boolean isLocalizedVariables()
void setLocalizedVariables(boolean flag)
flag
- true if localized, otherwise false.boolean isTypeRegistered(String type)
type
- the variable type.
List<VariableAttributeInfo> getAttributeList(String type)
type
- the variable type.
VariableInfo getVariableInfo(String type)
type
- the variable type.
void setVariableInfo(String type, VariableInfo info)
type
- the variable type.info
- the variable info or null.VariableAttributeInfo getAttributeInfo(String type, String name)
type
- the variable type.name
- the attribute name.
Collection<? extends VariableAttributeInfo> getAttributeInfo(String type)
type
- the variable type.
void setAttributeInfo(String type, Collection<? extends VariableAttributeInfo> attributes)
type
- the variable type.attributes
- a collection of VariableAttributeInfo instances.void setAttributeInfo(String type, String className, Collection<? extends VariableAttributeInfo> attributes)
The variable class has to implement the Variable
interface
If the named variable class is not available, it will be dynamically defined to be a subclass of the default base class.
type
- the variable type.className
- the class name.attributes
- a collection of VariableAttributeInfo instances.
ClassCastException
- if class name is invalid.void setAttributeInfo(String type, String className, String description, Collection<? extends VariableAttributeInfo> attributes)
type
- the variable type.className
- the class name.description
- the description.attributes
- a collection of VariableAttributeInfo instances.
ClassCastException
- if class name is invalid.void setAttributeInfo(String type, Collection<? extends VariableAttributeInfo> attributes, Descriptor descriptor)
type
- the variable type.attributes
- a collection of VariableAttributeInfo instances.descriptor
- the variable descriptor.void setAttributeInfo(String type, String className, Collection<? extends VariableAttributeInfo> attributes, Descriptor descriptor)
type
- the variable type.className
- the class name.attributes
- a collection of VariableAttributeInfo instances.descriptor
- the variable descriptor.
ClassCastException
- if class name is invalid.void setAttributeInfo(String type, String className, String description, Collection<? extends VariableAttributeInfo> attributes, Descriptor descriptor)
type
- the variable type.className
- the class name.description
- the description.attributes
- a collection of VariableAttributeInfo instances.descriptor
- the variable descriptor.
ClassCastException
- if class name is invalid.void setAttributeInfo(String className)
className
- the class name.
ClassCastException
- if class name is invalid.void removeAttributeInfo(String type)
type
- the variable type.void clearAllTypes()
Set<String> typeSet()
Set<String> typeSet(String prefix)
prefix
- a prefix.
Class<?> defineVariableClass(String className, Class<?>... ifaces) throws ClassNotFoundException, ClassFormatError
className
- the class name of the variable.ifaces
- optional interfaces.
ClassNotFoundException
- for missing classes.
ClassFormatError
- if the class hierarchy is invalid.Class<?> defineVariableClass(String className, Class<?> superClass, Class<?>... ifaces) throws ClassFormatError
className
- the class name of the variable.superClass
- the super class.ifaces
- optional interfaces.
ClassFormatError
- if the class hierarchy is invalid.Variable createVariable(String type) throws ConstructionException
type
- the type of the variable.
ConstructionException
- if construction fails.VariableAttributeInfo getAttributeNode(VariableAttributeInfo info, String... pattern)
info
- the recursive attribute info.pattern
- an optional pattern.
List<VariableAttributeInfo> getAttributeTree(VariableAttributeInfo info, String... pattern)
info
- the recursive attribute info.pattern
- an optional pattern.
Introspector createIntrospector()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |