metagloss 0.0.2

net.sf.metagloss.xml
Annotation Type XMLBind


@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
@Inherited
public @interface XMLBind

Annotation to mark setters for data injection from an XML document. Only applicable to public, single argument, methods.

See Also:
DOMFeeder.inject(Object), CursorBind

Optional Element Summary
 java.lang.String attribute
          If specified, will extract attribute's value from the element.
 boolean decimal
          Flag for specifying that the current integer value is retrieved as a decimal number.
 java.lang.String element
          The name of the XML tag.
 boolean mandatory
          If set to true, will throw an error if element or attribute doesn't exist.
 

element

public abstract java.lang.String element
The name of the XML tag. If not specified, will work work on the currently active element.

Returns:
The name of the column.
Default:
""

decimal

public abstract boolean decimal
Flag for specifying that the current integer value is retrieved as a decimal number. The decimal value is parsed as a double, before cast into the requested integer type primitive.

This flag has no effect on setters that don't take an int or long as argument.

Returns:
If true, casts to integer value.
Default:
false

attribute

public abstract java.lang.String attribute
If specified, will extract attribute's value from the element.

Returns:
Attribute key.
Default:
""

mandatory

public abstract boolean mandatory
If set to true, will throw an error if element or attribute doesn't exist. When set to false and DOMFeeder.setStrictChecking(boolean) is enabled, no exception will be thrown if element doesn't exist, nor will any XMLBindException data be printed to the logcat.

Returns:
True, if element is required.
Default:
true