Package cz.cvut.kbss.jopa.utils
Class IdentifierTransformer
java.lang.Object
cz.cvut.kbss.jopa.utils.IdentifierTransformer
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isValidIdentifierType
(Class<?> type) Checks whether the specified type is an identifier type supported by JOPA.static String
stringifyIri
(Object identifier) Stringifies the specified IRI identifier by enclosing it in < and >.static Object
transformToIdentifier
(Object value, Class<?> targetType) Transforms the specified value to the target identifier type (if possible).static URI
valueAsUri
(Object value)
-
Method Details
-
transformToIdentifier
Transforms the specified value to the target identifier type (if possible).- Parameters:
value
- The value to transformtargetType
- Target type- Returns:
- The transformed value
- Throws:
IllegalArgumentException
- If the target type is not a valid identifier type
-
valueAsUri
-
isValidIdentifierType
Checks whether the specified type is an identifier type supported by JOPA.- Parameters:
type
- The type to check- Returns:
true
if type is supported identifier type,false
otherwise
-
stringifyIri
Stringifies the specified IRI identifier by enclosing it in < and >.- Parameters:
identifier
- Identifier to stringify- Returns:
- String URI
-