|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jparam.JParam
This is the main JParam class, in order to use JParam, use the static methods of this class
Constructor Summary | |
JParam()
|
Method Summary | |
static java.lang.String |
help(java.lang.String topic)
This method should give help about certain parameters and status of JParam |
static void |
init()
Initializes all the registries of JParam, this must be called before JParam can be used |
static java.lang.Object |
parse(java.lang.String str)
Parse the given string into the Java object it represents |
static java.lang.Object |
readObject(java.io.InputStream in)
Parse an Object from the given input stream |
static void |
readValueSet(java.io.InputStream in,
AssignmentListener listener)
Read a set of values from the given stream, the notifyAssignemnt will be called for each assignment in the
input stream, this shouldn't be a public interface, but since Java lacks
the friend funcionality this has to be public for the
ParamSet class to reference |
static void |
registerClass(java.lang.String typeName,
java.lang.Class type)
Register the given Class as the given JParam type |
static void |
registerClass(java.lang.String typeName,
java.lang.Class type,
java.lang.Class helperClass)
Register the class as well as the gien helper class All methods from the helper class will be defined regardless of whether or not they are related to the given class |
static void |
registerConstant(java.lang.String name,
java.lang.Object value)
A helper method for registering constants, when the string literal name will be detected in the JParam input, it will be
switched with the given value |
static void |
registerHelperClass(java.lang.Class helperClass)
Register all available creators/converters/serializers/constants from the given helper class |
static java.lang.String |
toString(java.lang.Object obj)
Get the JParam string representation of the given Object, same restrictions like in writeObject |
static void |
writeObject(java.lang.Object obj,
java.io.PrintStream out)
Output the given object to the given PrintStream, the object's class and all of its internal members must be registered in JParam for this to work |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public JParam()
Method Detail |
public static void init()
public static java.lang.String help(java.lang.String topic)
topic
- public static java.lang.Object parse(java.lang.String str) throws JParamException
str
- A string representation in JParam formatJParamException
- if the parse failedpublic static java.lang.Object readObject(java.io.InputStream in) throws JParamException
in
- InputStream from which a JParam formatted string can be readpublic static void readValueSet(java.io.InputStream in, AssignmentListener listener) throws JParamException
notifyAssignemnt
will be called for each assignment in the
input stream, this shouldn't be a public interface, but since Java lacks
the friend funcionality this has to be public for the
ParamSet
class to referencein
- listener
- JParamException
- public static void writeObject(java.lang.Object obj, java.io.PrintStream out) throws JParamException
obj
- out
- JParamException
- public static java.lang.String toString(java.lang.Object obj) throws JParamException
writeObject
obj
- public static void registerClass(java.lang.String typeName, java.lang.Class type)
Class
as the given JParam typetypeName
- the type name in JParam syntax that will represent this classtype
- public static void registerClass(java.lang.String typeName, java.lang.Class type, java.lang.Class helperClass)
typeName
- type
- helperClass
- public static void registerHelperClass(java.lang.Class helperClass)
helperClass
- CreatorRegistry
,
SerializerRegistry
,
ConverterRegistry
,
ConstantRegistry
public static void registerConstant(java.lang.String name, java.lang.Object value)
name
will be detected in the JParam input, it will be
switched with the given valuename
- value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |