|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface StructMapper
Provides a mapping of struct names, field types and field names for
use in generators for persistence, serialization, or transformation
code. This is outside of the struct declaration itself, since a
single struct may have several mappings. The use of methods allows
for both ad hoc "lookup table" mapping, and/or "policy-based"
programmatic mapping strategies.
The methods are declared with ClassDoc/FieldDoc parameters, so
that the mapping process can leverage any declared metadata.
Sample use of a StructMapper:
The XYZMain deployment (for the XYZ application) wants to map a struct representation to database table with different name.
During the build process, the specified mapper is passed into the database generators. You can use an analogous approach for your own generators.
| Method Summary | |
|---|---|
java.lang.String |
getMappedFieldName(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
Returns the mapped name for the field. |
java.lang.String |
getMappedFieldRelation(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
Returns the mapped name for the relationship between the struct and the reference array field values. |
java.lang.String |
getMappedFieldRelationChild(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
In the relation between the struct and the reference array field values, return the name of the field representing the array field value. |
java.lang.String |
getMappedFieldRelationIndex(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
In the relation between the struct and the reference array field values, return the name of the field representing the ordering information for the array values. |
java.lang.String |
getMappedFieldRelationParent(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
In the relation between the struct and the reference array field values, return the name of the field representing the struct instance. |
java.lang.String |
getMappedFieldType(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
Returns the mapped type for the field. |
java.lang.String |
getMappedStructName(com.sun.javadoc.ClassDoc struct)
Returns the mapped name for the struct. |
| Method Detail |
|---|
java.lang.String getMappedStructName(com.sun.javadoc.ClassDoc struct)
java.lang.String getMappedFieldName(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
java.lang.String getMappedFieldType(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
java.lang.String getMappedFieldRelation(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
java.lang.String getMappedFieldRelationParent(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
java.lang.String getMappedFieldRelationChild(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
java.lang.String getMappedFieldRelationIndex(com.sun.javadoc.ClassDoc struct,
com.sun.javadoc.FieldDoc field)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||