public class MetadataValueTransform extends java.lang.Object implements Metadata.VirtualValue
Constructor and Description |
---|
MetadataValueTransform(MetadataKey<?>... inputSources)
Constructs a simple value transform using the given sources.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
generate(Element element,
ElementMetadata<?,?> metadata)
Runs this transformation on the given element.
|
void |
parse(Element element,
ElementMetadata<?,?> metadata,
java.lang.Object value)
For parsing, we always parse directly into the first source.
|
public MetadataValueTransform(MetadataKey<?>... inputSources)
inputSources
- the source keys to pull the values from.public java.lang.Object generate(Element element, ElementMetadata<?,?> metadata)
generate
in interface Metadata.VirtualValue
element
- the element to transform.metadata
- the metadata of the element being transformed.public void parse(Element element, ElementMetadata<?,?> metadata, java.lang.Object value) throws ParseException
parse
in interface Metadata.VirtualValue
ParseException
- if parsing fails.