Package overit.geocall.model
Class JackMapper
java.lang.Object
overit.geocall.model.JackMapper
- All Implemented Interfaces:
Serializable
Mapper used to extract or insert a set of properties inside a bean.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for JackMapperJackMapper(DocumentFormat df, ValidatorFactory validatorFactory, EDMRegistry edmRegistry, CriteriaSerializer serializeCriteria) Constructor for JackMapper -
Method Summary
Modifier and TypeMethodDescriptionCollects and returns all the properties of a bean without conversions, but respecting jackson annotationsCollects the properties of a bean-class respecting jackson annotationsFormat an objectvoidformat(Object o, OutputStream os) Format an objectvoidFormat an objectvoidformat(Object o, String charset, OutputStream os) Format an objectvoidInsert a set of properties inside a bean without conversions, but respecting jackson annotationsparse(InputStream is) Parse from an InputStream to create a JsonNode<T> Tparse(InputStream is, Class<T> c) Parse from an InputStream and return an object from the class passed as parameter<T> Tparse(InputStream is, String charset, Class<T> c) Parse from an InputStream and return an object from the class passed as parameterParse from a Reader<T> TParse from a Reader<T> TParse from a ReaderParse from a string<T> TParse from a string<T> TParse from a stringparseObject(Object src) Parse an object<T> TparseObject(Object src, Class<T> c) Parse an objectparseObject(DynO src) Parse an object<T> TparseObject(DynO src, Class<T> c) Parse an object<T> TUpdate an objectprotected voidvalidateObject(Object obj)
-
Constructor Details
-
JackMapper
Constructor for JackMapper- Parameters:
df- TheDocumentFormat
-
JackMapper
@Autowired public JackMapper(@Qualifier("json") DocumentFormat df, ValidatorFactory validatorFactory, EDMRegistry edmRegistry, CriteriaSerializer serializeCriteria) Constructor for JackMapper- Parameters:
df- TheDocumentFormatvalidatorFactory- factory used to create theValidatorused during the deserialization
-
-
Method Details
-
parse
Parse from an InputStream to create a JsonNode- Parameters:
is- The InputStream to parse- Returns:
- A JsonNode
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from an InputStream and return an object from the class passed as parameter- Type Parameters:
T- The type of the object requested- Parameters:
is- The InputStreamc- The requested class- Returns:
- An object from the requested class
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from an InputStream and return an object from the class passed as parameter- Type Parameters:
T- The type of the object requested- Parameters:
is- The InputStreamcharset- The charset for the InputStreamReaderc- The requested class- Returns:
- An object from the requested class
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from a Reader- Parameters:
r- The Reader- Returns:
- A JsonNode
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from a Reader- Type Parameters:
T- The type of the object requested- Parameters:
r- The Readerc- The requested class- Returns:
- An object from the requested class
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from a Reader- Type Parameters:
T- The type of the object requested- Parameters:
r- The Readerc- The requested generic class- Returns:
- An object from the requested class
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from a string- Parameters:
s- The string to parse- Returns:
- A JsonNode
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from a string- Type Parameters:
T- The type of the object requested- Parameters:
s- The string to parsec- The requested class- Returns:
- An object from the requested class
- Throws:
IOException- If an I/O error occurs
-
parse
Parse from a string- Type Parameters:
T- The type reference of the generic object requested- Parameters:
s- The string to parsec- The requested class- Returns:
- An object from the requested class
- Throws:
IOException- If an I/O error occurs
-
parseObject
Parse an object- Parameters:
src- The object to parse- Returns:
- A JsonNode
-
parseObject
Parse an object- Parameters:
src- The dyno to parse- Returns:
- A JsonNode
-
parseObject
Parse an object- Type Parameters:
T- The type of the DynO requested- Parameters:
src- The object to parsec- The requested class- Returns:
- An object from the requested class
-
parseObject
Parse an object- Type Parameters:
T- The type of the object requested- Parameters:
src- The object to parsec- The requested class- Returns:
- An object from the requested class
-
update
Update an object- Type Parameters:
T- The type of the object- Parameters:
src- Object to conceptually serialize and merge into value to updateto- Object to update- Returns:
- Either the second argument (`to`), if it is mutable; or a result of creating new instance that is result of "merging" values (for example, "updating" a Java array will create a new array)
- Throws:
JsonMappingException- If there are structural incompatibilities that prevent update
-
format
Format an object- Parameters:
o- The objectos- The OutputStream- Throws:
IOException- If an I/O error occurs
-
format
Format an object- Parameters:
o- The objectcharset- The charset for the OutputStreamWriteros- The OutputStream- Throws:
IOException- If an I/O error occurs
-
format
Format an object- Parameters:
o- The objectw- The Writer- Throws:
IOException- If an I/O error occurs
-
format
Format an object- Parameters:
o- The object- Returns:
- The string representing the formatted object
- Throws:
IOException- If an I/O error occurs
-
extract
Collects and returns all the properties of a bean without conversions, but respecting jackson annotations- Parameters:
o- The object to be introspectednullValues-truefor keeping null values inside the map,falseotherwiseany-truefor extracting also the additional properties with the Jackson any-getter,falseotherwise If any conflict exists between the concrete-properties and the any-properties, the concrete-property wins- Returns:
- The map containing all the properties. The key of the pair is the name the value is the property object
-
insert
Insert a set of properties inside a bean without conversions, but respecting jackson annotations- Parameters:
m- The collection of key-value properties to be insertedo- The object receiving the insertionsnullValues-truefor inserting null values inside the object,falseotherwiseany-truefor inserting absent bean properties to the any-setter if presents ,falseotherwise If any conflict exists between the concrete-properties and the any-properties, the value will be inserted in the concrete-property
-
fields
Collects the properties of a bean-class respecting jackson annotations- Parameters:
clz- The object to be introspectedout-trueto request all the properties used in formatting,falseotherwisein-trueto request all the properties used in parsing,falseotherwise- Returns:
- A set of Strings with all the requested properties
-
validateObject
-