public class OSLC4JUtils extends Object
Constructor and Description |
---|
OSLC4JUtils() |
Modifier and Type | Method and Description |
---|---|
static com.hp.hpl.jena.datatypes.RDFDatatype |
getDataTypeBasedOnResourceShapeType(HashSet<String> rdfTypesList,
com.hp.hpl.jena.rdf.model.Property property)
This method receives the property name and the property value and tries
to infer the property Data Type from the pre-defined list of Resource Shapes.
|
static String |
getInferTypeFromShape() |
static String |
getPublicURI()
Returns the value of org.eclipse.lyo.oslc4j.publicURI or null if not set.
|
static String |
getServletPath()
Return the servlet path value.
|
static String |
getServletURI()
Return the public URI including the servlet path.
|
static List<ResourceShape> |
getShapes()
Returns a list of Resource Shapes to be used when inferring a property
type from the Resource Shape.
|
static String |
getUseBeanClassForParsing() |
static Object |
getValueBasedOnResourceShapeType(HashSet<String> rdfTypesList,
QName propertyQName,
Object originalValue)
This method receives the property name and the property value and tries
to infer the property type from the pre-defined list of Resource Shapes.
|
static boolean |
inferTypeFromShape() |
static boolean |
isHostResolutionDisabled()
Returns the boolean value of org.eclipse.lyo.oslc4j.disableHostResolution
Default is false if not set or invalid (hostname resolution will take place)
|
static boolean |
isQueryResultListAsContainer()
Return if the query result list type will be
http://www.w3.org/2000/01/rdf-schema#Container or there will be no type.
|
static boolean |
relativeURIsAreDisabled()
Returns the boolean value of org.eclipse.lyo.oslc4j.disableRelativeURIs
Default is true if not set or invalid (relative URIs will not be allowed)
|
static String |
resolveFullUri(javax.servlet.http.HttpServletRequest request)
Resolve a full request URI (usually a resource subject or info URI) based on the settings of
org.eclipse.lyo.oslc4j.publicURI and org.eclipse.lyo.oslc4j.disableHostResolution.
|
static String |
resolveServletUri(javax.servlet.http.HttpServletRequest request)
Resolve a servlet URI based on the settings of
org.eclipse.lyo.oslc4j.publicURI and org.eclipse.lyo.oslc4j.disableHostResolution.
|
static String |
resolveURI(javax.servlet.http.HttpServletRequest request,
boolean includePath)
Deprecated.
Use
resolveFullUri(HttpServletRequest) instead. |
static void |
setHostResolutionDisabled(boolean hostResDisabled) |
static void |
setInferTypeFromShape(String inferTypeFromShape) |
static void |
setPublicURI(String newPublicURI)
Sets the value of org.eclipse.lyo.oslc4j.publicURI
|
static void |
setServletPath(String newServletPath)
Sets the value of the servlet path.
|
static void |
setShapes(List<ResourceShape> shapes)
Sets a list of Resource Shapes to be used when inferring a property type
from the Resource Shape.
|
static void |
setUseBeanClassForParsing(String useBeanClassForParsing) |
static boolean |
useBeanClassForParsing() |
public static String getPublicURI()
public static void setPublicURI(String newPublicURI) throws MalformedURLException
newPublicURI
- The new public URI to use.MalformedURLException
public static String getServletPath()
@Deprecated public static String resolveURI(javax.servlet.http.HttpServletRequest request, boolean includePath)
resolveFullUri(HttpServletRequest)
instead.request
- - request to base resolved URI onincludePath
- - if the path (after the context root) should be included in the
resolved URIpublic static String getServletURI()
public static boolean useBeanClassForParsing()
public static String getUseBeanClassForParsing()
public static void setUseBeanClassForParsing(String useBeanClassForParsing)
public static boolean inferTypeFromShape()
public static String getInferTypeFromShape()
public static void setInferTypeFromShape(String inferTypeFromShape)
public static List<ResourceShape> getShapes()
public static void setShapes(List<ResourceShape> shapes)
shapes
- List of Resource Shapespublic static boolean isHostResolutionDisabled()
public static void setHostResolutionDisabled(boolean hostResDisabled)
public static String resolveFullUri(javax.servlet.http.HttpServletRequest request)
request
- - request to base resolved URI onpublic static String resolveServletUri(javax.servlet.http.HttpServletRequest request)
request
- - request to base resolved URI onpublic static void setServletPath(String newServletPath)
newServletPath
- New servlet path to set or NULL to reset it.public static boolean relativeURIsAreDisabled()
public static boolean isQueryResultListAsContainer()
public static Object getValueBasedOnResourceShapeType(HashSet<String> rdfTypesList, QName propertyQName, Object originalValue) throws DatatypeConfigurationException, IllegalArgumentException, InstantiationException, InvocationTargetException
rdfTypesList
- propertyQName
- Property informationoriginalValue
- Property valueDatatypeConfigurationException
- , IllegalArgumentException, InstantiationException,
InvocationTargetException
onIllegalArgumentException
InstantiationException
InvocationTargetException
public static com.hp.hpl.jena.datatypes.RDFDatatype getDataTypeBasedOnResourceShapeType(HashSet<String> rdfTypesList, com.hp.hpl.jena.rdf.model.Property property)
rdfTypesList
- List of rdf:typesproperty
- Property informationDatatypeConfigurationException
- , IllegalArgumentException, InstantiationException,
InvocationTargetExceptionCopyright © 2017. All rights reserved.