public abstract class InfoObject
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected AnnotationInfo[] |
annotations |
protected java.lang.Object |
attr
user defined attribute objects.
|
protected AbstractTypeAnnotationInfo[] |
typeAnnotations |
Constructor and Description |
---|
InfoObject() |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AnnotationInfo newAnnotation) |
void |
addAnnotations(AnnotationInfo[] annotations) |
void |
addAttr(java.lang.Object a) |
void |
addTypeAnnotation(AbstractTypeAnnotationInfo newAnnotation) |
void |
addTypeAnnotations(AbstractTypeAnnotationInfo[] tas) |
ObjectList.Iterator |
attrIterator() |
<T> ObjectList.TypedIterator<T> |
attrIterator(java.lang.Class<T> attrType) |
AnnotationInfo |
getAnnotation(java.lang.String name) |
AnnotationInfo[] |
getAnnotations() |
java.lang.Object |
getAttr()
this returns all of them - use either if you know there will be only
one attribute at a time, or check/process result with ObjectList
|
<T> T |
getAttr(java.lang.Class<T> attrType)
this only returns the first attr of this type, there can be more
if you don't use client private types or the provided type is too general
|
AnnotationInfo[] |
getDeclaredAnnotations() |
<T> T |
getNextAttr(java.lang.Class<T> attrType,
java.lang.Object prev) |
<T extends AbstractTypeAnnotationInfo> |
getTargetTypeAnnotations(java.lang.Class<T> targetType) |
AbstractTypeAnnotationInfo |
getTypeAnnotation(java.lang.String annoClsName) |
AbstractTypeAnnotationInfo[] |
getTypeAnnotations() |
boolean |
hasAnnotation(java.lang.String name) |
boolean |
hasAnnotations() |
boolean |
hasAttr() |
boolean |
hasAttr(java.lang.Class<?> attrType) |
boolean |
hasAttrValue(java.lang.Object a) |
boolean |
hasTypeAnnotation(java.lang.String name) |
boolean |
hasTypeAnnotations() |
void |
removeAttr(java.lang.Object a) |
void |
replaceAttr(java.lang.Object oldAttr,
java.lang.Object newAttr) |
void |
setAnnotations(AnnotationInfo[] annotations) |
void |
setAttr(java.lang.Object a)
this replaces all of them - use only if you know
- there will be only one attribute at a time
- you obtained the value you set by a previous getXAttr()
- you constructed a multi value list with ObjectList.createList()
|
void |
setTypeAnnotations(AbstractTypeAnnotationInfo[] typeAnnotations) |
protected AnnotationInfo[] annotations
protected AbstractTypeAnnotationInfo[] typeAnnotations
protected java.lang.Object attr
public void setAnnotations(AnnotationInfo[] annotations)
public void addAnnotations(AnnotationInfo[] annotations)
public void addAnnotation(AnnotationInfo newAnnotation)
public boolean hasAnnotations()
public AnnotationInfo[] getAnnotations()
public AnnotationInfo getAnnotation(java.lang.String name)
public boolean hasAnnotation(java.lang.String name)
public AnnotationInfo[] getDeclaredAnnotations()
public void setTypeAnnotations(AbstractTypeAnnotationInfo[] typeAnnotations)
public void addTypeAnnotations(AbstractTypeAnnotationInfo[] tas)
public void addTypeAnnotation(AbstractTypeAnnotationInfo newAnnotation)
public AbstractTypeAnnotationInfo[] getTypeAnnotations()
public boolean hasTypeAnnotations()
public boolean hasTypeAnnotation(java.lang.String name)
public AbstractTypeAnnotationInfo getTypeAnnotation(java.lang.String annoClsName)
public <T extends AbstractTypeAnnotationInfo> java.util.List<T> getTargetTypeAnnotations(java.lang.Class<T> targetType)
public boolean hasAttr()
public boolean hasAttr(java.lang.Class<?> attrType)
public boolean hasAttrValue(java.lang.Object a)
public java.lang.Object getAttr()
public void setAttr(java.lang.Object a)
public void addAttr(java.lang.Object a)
public void removeAttr(java.lang.Object a)
public void replaceAttr(java.lang.Object oldAttr, java.lang.Object newAttr)
public <T> T getAttr(java.lang.Class<T> attrType)
public <T> T getNextAttr(java.lang.Class<T> attrType, java.lang.Object prev)
public ObjectList.Iterator attrIterator()
public <T> ObjectList.TypedIterator<T> attrIterator(java.lang.Class<T> attrType)