com.univocity.parsers.annotations
Annotation Type Linked


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

Links an attribute to the the results of an entity available in a Results instance. Regular attributes of any type are allowed if the results associated are expected to contain a single value. If there are multiple results the annotated attribute can be declared as an array or a collection type. If linking to a Map, you must add the Group annotation to the attribute to configure how the keys should be populated. The configuration in this Linked annotation will be used to populate the values of the map.

Author:
uniVocity Software Pty Ltd - parsers@univocity.com
See Also:
Group, Results, Result

Optional Element Summary
 Class container
          Provides the type of the collection to be instantiated for this linked attribute (if applicable).
 String entity
          The name of the entity in the Results instance whose rows will be read to generate instances of the given type().
 Class type
          The type of object that should be created for each Result associated with the given entity() name.
 

entity

public abstract String entity
The name of the entity in the Results instance whose rows will be read to generate instances of the given type(). If empty, the name of the attribute will be used as the entity name.

Returns:
name of the entity whose results should be linked to the parent instance.
Default:
""

type

public abstract Class type
The type of object that should be created for each Result associated with the given entity() name. Defaults to the actual attribute type. A type must be provided explicitly if the attribute is a collection.

Returns:
the type to be instantiated for each row linked to the parent instance.
Default:
java.lang.Object.class

container

public abstract Class container
Provides the type of the collection to be instantiated for this linked attribute (if applicable). The following defaults apply if the type of this attribute is not a concrete type:

Returns:
the concrete collection type to create for storing linked results of the given type()
Default:
java.lang.Object.class


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.