|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.sapjcosupport.ReflectionFieldIterator
Iterator implementation that iterates through the fields declared in a class, and retrieves the values for an instance.
This implementation does not support item removal, and will throw a
NotImplementedException
when the remove()
method is called.
Nested Class Summary | |
class |
ReflectionFieldIterator.IllegalAccessRuntimeException
RuntimeException wrapper for IllegalAccessException. |
class |
ReflectionFieldIterator.RuntimeWrapperException
Wraps any Throwable instance in a RuntimeException. |
Constructor Summary | |
ReflectionFieldIterator(Object instance)
Simple constructor. |
|
ReflectionFieldIterator(Object instance,
String regularExpression)
Advanced constructor. |
Method Summary | |
boolean |
hasNext()
Checks if more fields are available to iterate through. |
Object |
next()
Retrieves the next available field value. |
void |
remove()
Deprecated. Do not use this method, it is not implemented and throws a runtime exception |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReflectionFieldIterator(Object instance)
instance
- instance to operate onReflectionFieldIterator(Object, String)
public ReflectionFieldIterator(Object instance, String regularExpression)
This constructor accepts a regular expression by which the field names are evaluated.
Only fields with matching names will be considered; if the regularExpression
parameter is null or does not compile to a pattern, all fields will be considered.
If the instance passed to this constructor is null, no exception will be thrown, but the
hasNext()
method will return false
.
instance
- instance to operate onregularExpression
- regular expression pattern to match field namesMethod Detail |
public boolean hasNext()
hasNext
in interface Iterator
public Object next()
next
in interface Iterator
NoSuchElementException
- if no more objects are availablepublic void remove()
remove
in interface Iterator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |