| com.hp.hpl.jena.rdf.model.RDFNode
RDFNode | public interface RDFNode extends FrontsNode(Code) | | Interface covering RDF resources and literals. Allows probing whether a
node is a literal/[blank, URI]resource, moving nodes from model to model,
and viewing them as different Java types using the .as() polymorphism.
author: bwm, kers |
Method Summary | |
public RDFNode | as(Class view) RDFNodes can be converted to different implementation types. | public boolean | canAs(Class view) Answer true iff this RDFNode can be viewed as an instance of
view : that is, if it has already been viewed in this
way, or if it has an attached model in which it has properties that
permit it to be viewed in this way. | public RDFNode | inModel(Model m) Answer a .equals() version of this node, except that it's in the model
m . | public boolean | isAnon() Answer true iff this RDFNode is an anonynous resource. | public boolean | isLiteral() Answer true iff this RDFNode is a literal resource. | public boolean | isResource() Answer true iff this RDFNode is a URI resource or an anonynous
resource (ie is not a literal). | public boolean | isURIResource() Answer true iff this RDFNode is an named resource. | public String | toString() Answer a String representation of the node. | public Object | visitWith(RDFVisitor rv) Apply the appropriate method of the visitor to this node's content and
return the result. |
as | public RDFNode as(Class view)(Code) | | RDFNodes can be converted to different implementation types. Convert
this RDFNode to a type supporting the view interface. The
resulting RDFNode should be an instance of view and should
have any internal invariants as specified.
If the RDFNode has no Model attached, it can only be .as()ed to
a type it (this particular RDFNOde) already has.
If the RDFNode cannot be converted, an UnsupportedPolymorphism
exception is thrown..
|
canAs | public boolean canAs(Class view)(Code) | | Answer true iff this RDFNode can be viewed as an instance of
view : that is, if it has already been viewed in this
way, or if it has an attached model in which it has properties that
permit it to be viewed in this way. If canAs returns
true , as on the same view should
deliver an instance of that class.
|
inModel | public RDFNode inModel(Model m)(Code) | | Answer a .equals() version of this node, except that it's in the model
m .
Parameters: m - a model to move the node to this, if it's already in m (or no model), a copy in m otherwise |
isAnon | public boolean isAnon()(Code) | | Answer true iff this RDFNode is an anonynous resource. Useful for
one-off tests: see also visitWith() for making literal/anon/URI choices.
|
isLiteral | public boolean isLiteral()(Code) | | Answer true iff this RDFNode is a literal resource. Useful for
one-off tests: see also visitWith() for making literal/anon/URI choices.
|
isResource | public boolean isResource()(Code) | | Answer true iff this RDFNode is a URI resource or an anonynous
resource (ie is not a literal). Useful for one-off tests: see also
visitWith() for making literal/anon/URI choices.
|
isURIResource | public boolean isURIResource()(Code) | | Answer true iff this RDFNode is an named resource. Useful for
one-off tests: see also visitWith() for making literal/anon/URI choices.
|
toString | public String toString()(Code) | | Answer a String representation of the node. The form of the string
depends on the type of the node and is intended for human consumption,
not machine analysis.
|
visitWith | public Object visitWith(RDFVisitor rv)(Code) | | Apply the appropriate method of the visitor to this node's content and
return the result.
Parameters: rv - an RDFVisitor with a method for URI/blank/literal nodes the result returned by the selected method |
|
|