if (parameters != null)
{
JSONObject properties = new JSONObject();
for (Object p : parameters)
{
Annotation a = (Annotation) p;
String name = (String) a.get("name");
String type = a.get("type");
Class<?> classType;
try
{
classType = (type == null) ? String.class : Class.forName(Patterns.parseClass(type,
Patterns.CLASS, 1));
}
catch (ClassNotFoundException e)
{
// Theorically impossible
throw new IllegalArgumentException("Invalid Property type " + type
+ " from annotation " + annotation + " in class " + m_className);
}
Object[] values;
if ((values = a.get("value")) != null)
{
values = checkPropertyType(name, classType, values);
addProperty(properties, name, values, classType);
}
else if ((values = a.get("values")) != null)
{ // deprecated
values = checkPropertyType(name, classType, values);
addProperty(properties, name, values, classType);
}
else if ((values = a.get("longValue")) != null)
{
addProperty(properties, name, values, Long.class);
}
else if ((values = a.get("doubleValue")) != null)
{
addProperty(properties, name, values, Double.class);
}
else if ((values = a.get("floatValue")) != null)
{
addProperty(properties, name, values, Float.class);
}
else if ((values = a.get("intValue")) != null)
{
addProperty(properties, name, values, Integer.class);
}
else if ((values = a.get("byteValue")) != null)
{
addProperty(properties, name, values, Byte.class);
}
else if ((values = a.get("charValue")) != null)
{
addProperty(properties, name, values, Character.class);
}
else if ((values = a.get("booleanValue")) != null)
{
addProperty(properties, name, values, Boolean.class);
}
else if ((values = a.get("shortValue")) != null)
{
addProperty(properties, name, values, Short.class);
}
else
{