Class ResourcePackages
java.lang.Object
org.eclipse.lyo.oslc4j.provider.jena.ordfm.ResourcePackages
-
Method Summary
Modifier and TypeMethodDescriptiongetClassOf(Resource resource, Class<?>... preferredTypes) static voidmapPackage(Package pkg) Scans a package (recursively) searching for classes annotated withOslcResourceShapeand mapping them with anRDF.typebuilt by theTypeFactory.getQualifiedName(java.lang.Class)method.static voidreset()Reset all package registration.
-
Method Details
-
mapPackage
Scans a package (recursively) searching for classes annotated withOslcResourceShapeand mapping them with anRDF.typebuilt by theTypeFactory.getQualifiedName(java.lang.Class)method.- Parameters:
pkg- the package to scan.
-
getClassOf
- Parameters:
resource- the resource to resolve its type.preferredTypes- sometimes, the same RDF type is mapped by more than one class, in such cases this parameter indicates the preferred type to return in priority order. Avoid to use abstract types here.- Returns:
- an empty optional if there is not a mapped class for the given resource; it wrapped instance otherwise.
- Throws:
IllegalStateException- if more than one class (not in the same inheritance tree) is annotated to be mapped by the sameRDF:type.
-
reset
public static void reset()Reset all package registration.- Since:
- 4.0.0.RC
-