Package de.mhus.lib.core.pojo
Class MPojo
- java.lang.Object
-
- de.mhus.lib.core.pojo.MPojo
-
public class MPojo extends Object
-
-
Constructor Summary
Constructors Constructor Description MPojo()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddJsonValue(org.codehaus.jackson.node.ArrayNode to, Object value, PojoModelFactory factory, boolean usePublic, boolean deep, int level)static PojoModelFactorygetAttributeModelFactory()static PojoModelFactorygetDefaultModelFactory()static voidjsonToPojo(org.codehaus.jackson.JsonNode from, Object to)static voidjsonToPojo(org.codehaus.jackson.JsonNode from, Object to, PojoModelFactory factory)static voidpojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to)static voidpojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to, PojoModelFactory factory)static voidpojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to, PojoModelFactory factory, boolean usePublic)static voidpojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to, PojoModelFactory factory, boolean usePublic, int level)static IPropertiespojoToProperties(Object from)static IPropertiespojoToProperties(Object from, PojoModelFactory factory)static voidpojoToXml(Object from, Element to)static voidpojoToXml(Object from, Element to, PojoModelFactory factory)static voidpojoToXml(Object from, Element to, PojoModelFactory factory, int level)static voidpropertiesToPojo(IProperties from, Object to)static voidpropertiesToPojo(IProperties from, Object to, PojoModelFactory factory)static voidpropertiesToPojo(IProperties from, Object to, PojoModelFactory factory, Caster<Object,Object> unknownHadler)static voidpropertiesToPojo(Map<String,String> from, Object to, TransformHelper helper)static voidsetJsonValue(org.codehaus.jackson.node.ObjectNode to, String name, Object value, PojoModelFactory factory, boolean usePublic, boolean deep, int level)static StringtoAttributeName(de.mhus.lib.basics.consts.Identifier... idents)toAttributeName.static StringtoFunctionName(String in, boolean firstUpper, String def)Functionize a String.static voidxmlToPojo(Element from, Object to, MActivator act)static voidxmlToPojo(Element from, Object to, PojoModelFactory factory, MActivator act)
-
-
-
Field Detail
-
DEEP
public static final String DEEP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultModelFactory
public static PojoModelFactory getDefaultModelFactory()
-
getAttributeModelFactory
public static PojoModelFactory getAttributeModelFactory()
-
pojoToJson
public static void pojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to) throws IOException
- Throws:
IOException
-
pojoToJson
public static void pojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to, PojoModelFactory factory) throws IOException
- Throws:
IOException
-
pojoToJson
public static void pojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to, PojoModelFactory factory, boolean usePublic) throws IOException
- Throws:
IOException
-
pojoToJson
public static void pojoToJson(Object from, org.codehaus.jackson.node.ObjectNode to, PojoModelFactory factory, boolean usePublic, int level) throws IOException
- Throws:
IOException
-
addJsonValue
public static void addJsonValue(org.codehaus.jackson.node.ArrayNode to, Object value, PojoModelFactory factory, boolean usePublic, boolean deep, int level) throws IOException- Throws:
IOException
-
setJsonValue
public static void setJsonValue(org.codehaus.jackson.node.ObjectNode to, String name, Object value, PojoModelFactory factory, boolean usePublic, boolean deep, int level) throws IOException- Throws:
IOException
-
jsonToPojo
public static void jsonToPojo(org.codehaus.jackson.JsonNode from, Object to) throws IOException- Throws:
IOException
-
jsonToPojo
public static void jsonToPojo(org.codehaus.jackson.JsonNode from, Object to, PojoModelFactory factory) throws IOException- Throws:
IOException
-
pojoToXml
public static void pojoToXml(Object from, Element to) throws IOException
- Throws:
IOException
-
pojoToXml
public static void pojoToXml(Object from, Element to, PojoModelFactory factory) throws IOException
- Throws:
IOException
-
pojoToXml
public static void pojoToXml(Object from, Element to, PojoModelFactory factory, int level) throws IOException
- Throws:
IOException
-
xmlToPojo
public static void xmlToPojo(Element from, Object to, MActivator act) throws IOException
- Throws:
IOException
-
xmlToPojo
public static void xmlToPojo(Element from, Object to, PojoModelFactory factory, MActivator act) throws IOException
- Throws:
IOException
-
toFunctionName
public static String toFunctionName(String in, boolean firstUpper, String def)
Functionize a String. Remove bad names and set first characters to upper. Return def if the name can't be created, e.g. only numbers.- Parameters:
in-firstUpper-def-- Returns:
- The function name
-
pojoToProperties
public static IProperties pojoToProperties(Object from) throws IOException
- Throws:
IOException
-
pojoToProperties
public static IProperties pojoToProperties(Object from, PojoModelFactory factory) throws IOException
- Throws:
IOException
-
propertiesToPojo
public static void propertiesToPojo(IProperties from, Object to) throws IOException
- Throws:
IOException
-
propertiesToPojo
public static void propertiesToPojo(IProperties from, Object to, PojoModelFactory factory) throws IOException
- Throws:
IOException
-
propertiesToPojo
public static void propertiesToPojo(IProperties from, Object to, PojoModelFactory factory, Caster<Object,Object> unknownHadler) throws IOException
- Throws:
IOException
-
toAttributeName
public static String toAttributeName(de.mhus.lib.basics.consts.Identifier... idents)
toAttributeName.
- Parameters:
idents-- Returns:
- a
Stringobject. - Since:
- 3.3.0
-
propertiesToPojo
public static void propertiesToPojo(Map<String,String> from, Object to, TransformHelper helper) throws IOException
- Throws:
IOException
-
-