public abstract class InfoObject extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
protected AnnotationInfo[] |
annotations |
protected Object |
attr
user defined attribute objects.
|
Constructor and Description |
---|
InfoObject() |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AnnotationInfo newAnnotation) |
void |
addAttr(Object a) |
ObjectList.Iterator |
attrIterator() |
<T> ObjectList.TypedIterator<T> |
attrIterator(Class<T> attrType) |
AnnotationInfo |
getAnnotation(String name) |
AnnotationInfo[] |
getAnnotations() |
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(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(Class<T> attrType,
Object prev) |
boolean |
hasAnnotations() |
boolean |
hasAttr() |
boolean |
hasAttr(Class<?> attrType) |
boolean |
hasAttrValue(Object a) |
void |
removeAttr(Object a) |
void |
replaceAttr(Object oldAttr,
Object newAttr) |
void |
setAnnotations(AnnotationInfo[] annotations) |
void |
setAttr(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()
|
protected AnnotationInfo[] annotations
protected Object attr
public void setAnnotations(AnnotationInfo[] annotations)
public void addAnnotation(AnnotationInfo newAnnotation)
public boolean hasAnnotations()
public AnnotationInfo[] getAnnotations()
public AnnotationInfo getAnnotation(String name)
public AnnotationInfo[] getDeclaredAnnotations()
public boolean hasAttr()
public boolean hasAttr(Class<?> attrType)
public boolean hasAttrValue(Object a)
public Object getAttr()
public void setAttr(Object a)
public void addAttr(Object a)
public void removeAttr(Object a)
public <T> T getAttr(Class<T> attrType)
public ObjectList.Iterator attrIterator()
public <T> ObjectList.TypedIterator<T> attrIterator(Class<T> attrType)