Module org.apache.jena.ontapi
Package org.apache.jena.ontapi.common
Class CompositeEnhNodeFactoryImpl
java.lang.Object
org.apache.jena.enhanced.Implementation
org.apache.jena.ontapi.common.BaseEnhNodeFactoryImpl
org.apache.jena.ontapi.common.CompositeEnhNodeFactoryImpl
- All Implemented Interfaces:
EnhNodeFactory
A
Ontology Object Factory implementation to combine several other factories.-
Constructor Summary
ConstructorsConstructorDescriptionCompositeEnhNodeFactoryImpl(EnhNodeFinder finder, EnhNodeFilter fittingFilter, EnhNodeFactory... factories) Creates a factory instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanWrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Checks that the wrapping (node,eg) would succeed.org.apache.jena.enhanced.EnhNodecreateInstance(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Wraps the given pair ofnodeandgraphto a freshEnhNodeinstance without any checking or throwing any exception.org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.enhanced.EnhNode>iterator(org.apache.jena.enhanced.EnhGraph eg) Returns anExtended Iteratorover thenodes found in theEnhGraphin the form ofEnhNodewith the interface that this factory encapsulates.org.apache.jena.util.iterator.ExtendedIterator<? extends EnhNodeFactory>Lists all sub-factories.org.apache.jena.enhanced.EnhNodewrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Creates a newEnhNodewrapping the givenNodenode in the context of the graphEnhGraph.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.ontapi.common.EnhNodeFactory
canCreateInGraph, createInGraph, find
-
Constructor Details
-
CompositeEnhNodeFactoryImpl
public CompositeEnhNodeFactoryImpl(EnhNodeFinder finder, EnhNodeFilter fittingFilter, EnhNodeFactory... factories) Creates a factory instance.- Parameters:
finder-EnhNodeFinder, optional, ifnullthen uses only provided sub-factories to searchfittingFilter-EnhNodeFilter, optional, to trim searchingfactories- array of factories to combine, must not benullor empty
-
-
Method Details
-
wrap
public org.apache.jena.enhanced.EnhNode wrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from class:BaseEnhNodeFactoryImplCreates a newEnhNodewrapping the givenNodenode in the context of the graphEnhGraph.- Specified by:
wrapin interfaceEnhNodeFactory- Overrides:
wrapin classBaseEnhNodeFactoryImpl- Parameters:
node- the node to be wrappedeg- the graph containing the node- Returns:
- A new enhanced node which wraps node but presents the interface(s) that this factory encapsulates.
-
canWrap
public boolean canWrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactoryChecks that the wrapping (node,eg) would succeed.- Specified by:
canWrapin interfaceEnhNodeFactory- Specified by:
canWrapin classorg.apache.jena.enhanced.Implementation- Parameters:
node- node the node to test for suitabilityeg- the enhanced graph the node appears in- Returns:
trueiff thenodecan represent the type in the graph
-
createInstance
public org.apache.jena.enhanced.EnhNode createInstance(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactoryWraps the given pair ofnodeandgraphto a freshEnhNodeinstance without any checking or throwing any exception. Some implementations may returnnullif theEnhNodeFactory.canWrap(Node, EnhGraph)returnsfalse. Unlike the methodEnhNodeFactory.createInGraph(Node, EnhGraph), this method does not make any changes to the graph.- Parameters:
node-Node, notnulleg-EnhGraph, notnull- Returns:
EnhNodeornull
-
iterator
public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.enhanced.EnhNode> iterator(org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactoryReturns anExtended Iteratorover thenodes found in theEnhGraphin the form ofEnhNodewith the interface that this factory encapsulates. It is assumed that the returned iterator is distinct (does not answer with duplicates). At least, it must be distinct if theEnhGraphencapsulates the distinct graph (see alsoGraphs.isDistinct(Graph)).- Parameters:
eg-EnhGraph- Returns:
ExtendedIteratorofEnhNodes
-
getFinder
-
getFilter
-
listFactories
Lists all sub-factories.- Returns:
ExtendedIteratorofEnhNodeFactory
-