JETTY-1283 javadoc
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2360 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
da54b0d2e8
commit
236a0c3b86
|
@ -34,8 +34,6 @@ import org.eclipse.jetty.util.log.Log;
|
|||
* - the getters/setters are resolved at initialization (JSONObjectConverter resolves it at runtime)
|
||||
* - correctly sets the number fields
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class JSONPojoConvertor implements JSON.Convertor
|
||||
{
|
||||
|
@ -53,22 +51,38 @@ public class JSONPojoConvertor implements JSON.Convertor
|
|||
protected Map<String,Method> _getters = new HashMap<String,Method>();
|
||||
protected Map<String,Setter> _setters = new HashMap<String,Setter>();
|
||||
protected Set<String> _excluded;
|
||||
|
||||
|
||||
/**
|
||||
* @param pojoClass The class to convert
|
||||
*/
|
||||
public JSONPojoConvertor(Class<?> pojoClass)
|
||||
{
|
||||
this(pojoClass, (Set<String>)null, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param pojoClass The class to convert
|
||||
* @param excluded The fields to exclude
|
||||
*/
|
||||
public JSONPojoConvertor(Class<?> pojoClass, String[] excluded)
|
||||
{
|
||||
this(pojoClass, new HashSet<String>(Arrays.asList(excluded)), true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param pojoClass The class to convert
|
||||
* @param excluded The fields to exclude
|
||||
*/
|
||||
public JSONPojoConvertor(Class<?> pojoClass, Set<String> excluded)
|
||||
{
|
||||
this(pojoClass, excluded, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param pojoClass The class to convert
|
||||
* @param excluded The fields to exclude
|
||||
* @param fromJSON If true, add a class field to the JSON
|
||||
*/
|
||||
public JSONPojoConvertor(Class<?> pojoClass, Set<String> excluded, boolean fromJSON)
|
||||
{
|
||||
_pojoClass = pojoClass;
|
||||
|
@ -76,7 +90,11 @@ public class JSONPojoConvertor implements JSON.Convertor
|
|||
_fromJSON = fromJSON;
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param pojoClass The class to convert
|
||||
* @param fromJSON If true, add a class field to the JSON
|
||||
*/
|
||||
public JSONPojoConvertor(Class<?> pojoClass, boolean fromJSON)
|
||||
{
|
||||
this(pojoClass, (Set<String>)null, fromJSON);
|
||||
|
|
Loading…
Reference in New Issue