Package org.somda.sdc.common.util
Interface JaxbUtil
-
- All Implemented Interfaces:
public interface JaxbUtilUtility functions for JAXB.
-
-
Method Summary
Modifier and Type Method Description abstract <T> Optional<T>extractElement(Object element, Class<T> typeClass)Tries to cast the element to given type object and returns it as an Optional. abstract <T> Optional<T>extractElement(Object element, QName elementType)Tries to cast the element to a JAXBElement object with given QName type and returns it as an Optional. abstract <T> Optional<T>extractElement(Object element, QName elementType, Class<T> typeClass)Same as extractElement but with QName JAXB type class in addition. abstract <T> Optional<T>extractFirstElementFromAny(List<Object> anyList, QName elementType, Class<T> typeClass)From a list of JAXBElement objects, this function retrieves the first element in the list Additionally, it tries to cast it to the QName type given by elementType. abstract <T> Optional<T>extractFirstElementFromAny(List<Object> anyList, Class<T> typeClass)Same as extractFirstElementFromAny, but without comparing QName in advance. -
-
Method Detail
-
extractElement
abstract <T> Optional<T> extractElement(Object element, Class<T> typeClass)
Tries to cast the element to given type object and returns it as an Optional.
- Parameters:
element- the element to inspect.typeClass- the QName type specification.- Returns:
getValue or empty on error.
-
extractElement
abstract <T> Optional<T> extractElement(Object element, QName elementType)
Tries to cast the element to a JAXBElement object with given QName type and returns it as an Optional.
- Parameters:
element- the element to inspect.elementType- the QName type specification.- Returns:
getValue or empty on error.
-
extractElement
abstract <T> Optional<T> extractElement(Object element, QName elementType, Class<T> typeClass)
Same as extractElement but with QName JAXB type class in addition.
- Parameters:
element- the element to inspect.elementType- the QName type specification.typeClass- Java JAXB class that matches elementType.- Returns:
getValue or empty on error.
-
extractFirstElementFromAny
abstract <T> Optional<T> extractFirstElementFromAny(List<Object> anyList, QName elementType, Class<T> typeClass)
From a list of JAXBElement objects, this function retrieves the first element in the list
Additionally, it tries to cast it to the QName type given by elementType.
-
extractFirstElementFromAny
abstract <T> Optional<T> extractFirstElementFromAny(List<Object> anyList, Class<T> typeClass)
Same as extractFirstElementFromAny, but without comparing QName in advance.
-
-
-
-