public class ComponentDefinition extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ComponentDefinition.Cardinality
Represents the cardinality of a child tag.
|
| 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()
Returns true if this component allows children.
|
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.
|
String |
getDescription()
Returns the description of this component.
|
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.
|
DeferredInvocation<?> |
setProperty(BaseComponent instance,
String name,
Object value)
Sets a property value or defers that operation if the property is marked as such.
|
boolean |
validateAttribute(String name)
Returns true if attribute name is validate for this component definition.
|
void |
validateChild(ComponentDefinition childDefinition,
IntSupplier childCount)
Validate that a child defined by the component definition is valid for this parent.
|
void |
validateParent(ComponentDefinition parentDefinition)
Validate that a component defined by the component definition is a valid parent for this
component.
|
public ComponentDefinition(Class<? extends BaseComponent> componentClass)
componentClass - A component class.public Object getProperty(BaseComponent instance, String name)
instance - Instance to retrieve property from.name - Name of property.public boolean validateAttribute(String name)
name - The attribute name.public DeferredInvocation<?> setProperty(BaseComponent instance, String name, Object value)
instance - Instance containing the property.name - Name of property.value - The value to set.public String getTag()
public Class<? extends BaseComponent> getComponentClass()
public Class<? extends ComponentFactory> getFactoryClass()
public String getDescription()
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)
childDefinition - Definition for child component.childCount - Current child count.ComponentException - Thrown if child fails validation.public void validateParent(ComponentDefinition parentDefinition)
parentDefinition - Definition for parent component.ComponentException - Thrown if child fails validation.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 © 2018 Regenstrief Center for Biomedical Informatics. All rights reserved.