|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object joperties.interpreters.AbstractInterpreter<java.util.Collection<T>> joperties.interpreters.CollectionInterpreter<T>
public class CollectionInterpreter<T>
This is a Collection Interpreter which is a special kind of interpreter since it is generic. Generic interpreters cannot be registered since the type of their collection contents are erased at runtime. Therefore these interpreters must be called manually.
Field Summary | |
---|---|
private java.lang.Class<T> |
classInCollection
This serves as a place holder for the type T so that it's possible to return a class of type Class |
private java.lang.String |
COLLECTION_SEPERATOR
|
private java.util.Collection<T> |
internal
This serves as a place holder for the type T so that it's possible to return a class of type Class |
Constructor Summary | |
---|---|
CollectionInterpreter(java.lang.Class<T> classInCollection)
This constructor takes a class as a parameter to act as a place holder for the type T so that it's possible to return a class of type Class |
Method Summary | |
---|---|
java.lang.String |
encode(java.util.Collection<T> obj)
This method encodes the provided object to a string. |
java.lang.Class<java.util.Collection<T>> |
getClassType()
This method returns the class that this interpreted handles. |
java.lang.String |
getCollectionSeperator()
This method returns the String used as the separator for items in a collection. |
java.lang.String |
getDescription()
This method returns a description of the way this interpreter interprets and encodes the objects. |
java.util.Collection<T> |
interpret(java.lang.String string)
This method will interpret the provided string as an object. |
void |
setCollectionSeperator(java.lang.String seperator)
This method sets the String used as the separator for items in a collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String COLLECTION_SEPERATOR
private java.util.Collection<T> internal
private java.lang.Class<T> classInCollection
Constructor Detail |
---|
public CollectionInterpreter(java.lang.Class<T> classInCollection)
classInCollection
- The class of the objects that are placed in the collection.Method Detail |
---|
public java.lang.String encode(java.util.Collection<T> obj) throws EncodingException, NoApropriateInterpeterFoundException
AbstractInterpreter
encode
in class AbstractInterpreter<java.util.Collection<T>>
obj
- The object to encode as a string.
EncodingException
- If there was an error encoding the string.
NoApropriateInterpeterFoundException
- If the method needs to call on other interpreters and none is
found.public java.lang.Class<java.util.Collection<T>> getClassType()
AbstractInterpreter
getClassType
in class AbstractInterpreter<java.util.Collection<T>>
public java.lang.String getDescription()
AbstractInterpreter
getDescription
in class AbstractInterpreter<java.util.Collection<T>>
public java.util.Collection<T> interpret(java.lang.String string) throws InterpretationException, NoApropriateInterpeterFoundException
AbstractInterpreter
interpret
in class AbstractInterpreter<java.util.Collection<T>>
string
- The string to interpret as an object.
InterpretationException
- If there was an error interpreting the string.
NoApropriateInterpeterFoundException
- If the method needs to call on other interpreters and none is
found.public void setCollectionSeperator(java.lang.String seperator)
seperator
- The String used as the separator for items in a collection.public java.lang.String getCollectionSeperator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |