public class ComponentDefinition extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ComponentDefinition.Cardinality
Represents the cardinality of a child tag.
|
static class |
ComponentDefinition.DeferredSetter
Stores a method invocation to be executed at a later time.
|
| Constructor and Description |
|---|
ComponentDefinition(Class<? extends BaseComponent> componentClass)
Creates a component definition derived from annotation information within the specified
class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
childrenAllowed() |
Component.ContentHandling |
contentHandling()
Returns how to handle content for this component type.
|
boolean |
equals(Object object) |
ComponentDefinition.Cardinality |
getCardinality(String childTag)
Returns the cardinality of a child tag.
|
Map<String,ComponentDefinition.Cardinality> |
getChildTags()
Returns an immutable map of all child tags.
|
Class<? extends BaseComponent> |
getComponentClass()
Returns the implementation class for this component type.
|
ComponentFactory |
getFactory()
Returns a factory instance for this component.
|
Class<? extends ComponentFactory> |
getFactoryClass()
Returns the factory class for this component type.
|
Map<String,Method> |
getFactoryParameters()
Returns an immutable map of factory parameters.
|
Map<String,Method> |
getGetters()
Returns an immutable map of getter methods.
|
Set<String> |
getParentTags()
Returns an immutable set of parent tags.
|
Object |
getProperty(BaseComponent instance,
String name)
Returns The value of the named property.
|
Map<String,Method> |
getSetters()
Returns an immutable map of setter methods.
|
String |
getTag()
Returns the XML tag for this component type.
|
String |
getWidgetClass()
Returns the javascript class for the widget.
|
String |
getWidgetModule()
Returns the javascript module containing the widget class.
|
boolean |
isParentTag(String tag)
Returns true if the tag is a valid parent tag.
|
ComponentDefinition.DeferredSetter |
setProperty(BaseComponent instance,
String name,
Object value)
Sets a property value or defers that operation if the property is marked as such.
|
void |
validateChild(ComponentDefinition childDefinition,
IntSupplier childCount) |
void |
validateParent(ComponentDefinition parentDefinition) |
public ComponentDefinition(Class<? extends BaseComponent> componentClass)
componentClass - A component class.public Object getProperty(BaseComponent instance, String name) throws Exception
instance - Instance to retrieve property from.name - Name of property.Exception - Unspecified exceptionpublic ComponentDefinition.DeferredSetter setProperty(BaseComponent instance, String name, Object value)
instance - Instance containing the property or attribute map.name - Name of property or attribute. If prefixed with "@", is interpreted as an
attribute name; otherwise as a property name.value - The value to set.public String getTag()
public Class<? extends BaseComponent> getComponentClass()
public Class<? extends ComponentFactory> getFactoryClass()
public ComponentFactory getFactory()
public String getWidgetModule()
public String getWidgetClass()
public ComponentDefinition.Cardinality getCardinality(String childTag)
childTag - A child tag.public Map<String,ComponentDefinition.Cardinality> getChildTags()
public boolean childrenAllowed()
public void validateChild(ComponentDefinition childDefinition, IntSupplier childCount)
public void validateParent(ComponentDefinition parentDefinition)
public boolean isParentTag(String tag)
tag - Tag to be tested.public Set<String> getParentTags()
public Component.ContentHandling contentHandling()
public Map<String,Method> getGetters()
public Map<String,Method> getSetters()
public Map<String,Method> getFactoryParameters()
Copyright © 2017 Regenstrief Center for Biomedical Informatics. All rights reserved.