Annotation Type IndexField
-
@Retention(RUNTIME) @Target(METHOD) @Documented public @interface IndexField
Annotation that can be used on a public getter method to indicate that its return value or object should be indexed. If a name is specified, the value of the name will be used as the indexing field. If name is missing, the name of the getter method is used without the 'get' or 'is' part and the first letter lowercased. Thus for example
public class NewsBean extends BaseBean{ @IndexField public String getAuthor() { // return author } }
public class NewsBean extends BaseBean{ @IndexField(name="writer") public String getAuthor() { // return author } }
Expert
Adding ignoreInCompound = true Makes it possible to annotate a method that should not be indexed for compound
ContentBean
s. For example when you have the bean structure below, you do not need the getPath, canonicalUUID, etc etc from the Author to be indexed. By adding this (ignoreInCompound = true) to the IndexField annotation, the method will be skipped when indexing a compound bean into its container bean Default, ignoreInCompound is false when not specifiedpublic class NewsBean implements IdendifiableContentBean { public String getPath() { // return path } public void setPath(String path) { // set path } @IndexField public Author getAuthor() { // return author } } // the Compound public class Author implements IdendifiableContentBean { public String getPath() { // return path } public void setPath(String path) { // set path } @IndexField public String getName() { // return name } } public interface IdendifiableContentBean { @IndexField(name="id", ignoreInCompound = true) public String getPath(); public void setPath(String path); }
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
ignoreInCompound
String
name
-