|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.ui.declarative.DesignAttributeHandler
public class DesignAttributeHandler
Default attribute handler implementation used when parsing designs to component trees. Handles all the component attributes that do not require custom handling.
| Constructor Summary | |
|---|---|
DesignAttributeHandler()
|
|
| Method Summary | ||
|---|---|---|
static boolean |
assignValue(java.lang.Object target,
java.lang.String attribute,
java.lang.String value)
Assigns the specified design attribute to the given component. |
|
static void |
clearElement(org.jsoup.nodes.Element design)
Clears the children and attributes of the given element |
|
static DesignFormatter |
getFormatter()
Returns the currently used formatter. |
|
static java.util.Collection<java.lang.String> |
getSupportedAttributes(java.lang.Class<?> clazz)
Searches for supported setter and getter types from the specified class and returns the list of corresponding design attributes |
|
static Alignment |
readAlignment(org.jsoup.nodes.Attributes attr)
Read the alignment from the given child component attributes. |
|
static
|
readAttribute(java.lang.String attribute,
org.jsoup.nodes.Attributes attributes,
java.lang.Class<T> outputType)
Reads the given attribute from a set of attributes. |
|
static
|
readAttribute(java.lang.String attribute,
org.jsoup.nodes.Attributes attributes,
T defaultValue,
java.lang.Class<T> outputType)
Reads the given attribute from a set of attributes. |
|
static void |
writeAlignment(org.jsoup.nodes.Element childElement,
Alignment alignment)
Writes the alignment to the given child element attributes. |
|
static void |
writeAttribute(java.lang.Object component,
java.lang.String attribute,
org.jsoup.nodes.Attributes attr,
java.lang.Object defaultInstance)
Writes the specified attribute to the design if it differs from the default value got from the defaultInstance |
|
static
|
writeAttribute(java.lang.String attribute,
org.jsoup.nodes.Attributes attributes,
T value,
T defaultValue,
java.lang.Class<T> inputType)
Writes the given attribute value to a set of attributes if it differs from the default attribute value. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DesignAttributeHandler()
| Method Detail |
|---|
public static DesignFormatter getFormatter()
public static void clearElement(org.jsoup.nodes.Element design)
design - the element to be cleared
public static boolean assignValue(java.lang.Object target,
java.lang.String attribute,
java.lang.String value)
target - the target to which the attribute should be setattribute - the name of the attribute to be setvalue - the string value of the attribute
public static java.util.Collection<java.lang.String> getSupportedAttributes(java.lang.Class<?> clazz)
clazz - the class scanned for setters
public static void writeAttribute(java.lang.Object component,
java.lang.String attribute,
org.jsoup.nodes.Attributes attr,
java.lang.Object defaultInstance)
defaultInstance
- Parameters:
component - the component used to get the attribute valueattribute - the key for the attributeattr - the attribute list where the attribute will be writtendefaultInstance - the default instance for comparing default values
public static <T> void writeAttribute(java.lang.String attribute,
org.jsoup.nodes.Attributes attributes,
T value,
T defaultValue,
java.lang.Class<T> inputType)
attribute - the attribute keyattributes - the set of attributes where the new attribute is writtenvalue - the attribute valuedefaultValue - the default attribute valueinputType - the type of the input value
public static <T> T readAttribute(java.lang.String attribute,
org.jsoup.nodes.Attributes attributes,
T defaultValue,
java.lang.Class<T> outputType)
attribute - the attribute keyattributes - the set of attributes to read fromdefaultValue - the default value to return if attribute does not existoutputType - the output type for the attribute
public static <T> T readAttribute(java.lang.String attribute,
org.jsoup.nodes.Attributes attributes,
java.lang.Class<T> outputType)
attribute - the attribute keyattributes - the set of attributes to read fromoutputType - the output type for the attribute
public static Alignment readAlignment(org.jsoup.nodes.Attributes attr)
attr - the child component attributes
public static void writeAlignment(org.jsoup.nodes.Element childElement,
Alignment alignment)
childElement - the child elementalignment - the component alignment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||