Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add unsupported operation exceptions for api methods that are not sup…

…ported in m2.
  • Loading branch information...
commit eff6cd6c764da31df68650fe3f571cfe36fff478 1 parent be4b3c3
Bill Millar authored
View
80 src/com/franz/agraph/jena/AGGraph.java
@@ -26,7 +26,6 @@
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.TripleMatch;
import com.hp.hpl.jena.graph.impl.GraphBase;
-import com.hp.hpl.jena.graph.query.QueryHandler;
import com.hp.hpl.jena.shared.AddDeniedException;
import com.hp.hpl.jena.shared.DeleteDeniedException;
import com.hp.hpl.jena.shared.PrefixMapping;
@@ -71,100 +70,21 @@ AGRepositoryConnection getConnection() {
public void close() {
}
- /*
- * @Override public boolean contains(Triple t) { // TODO Auto-generated
- * method stub return false; }
- *
- * @Override public boolean contains(Node s, Node p, Node o) { // TODO
- * Auto-generated method stub return false; }
- */
-
- /*
- * @Override public void delete(Triple t) throws DeleteDeniedException { try
- * { conn.remove(vf.asResource(t.getSubject()), vf.asURI(t.getPredicate()),
- * vf.asValue(t.getObject()), context); } catch (UnauthorizedException e) {
- * throw new DeleteDeniedException(e.getMessage()); } catch
- * (RepositoryException e) { throw new RuntimeException(e); } }
- *
- * @Override public boolean dependsOn(Graph other) { // TODO Auto-generated
- * method stub return false; }
- *
- * @Override public ExtendedIterator<Triple> find(TripleMatch m) { return
- * find(m.getMatchSubject(),m.getMatchPredicate(),m.getMatchObject()); }
- *
- * @Override public ExtendedIterator<Triple> find(Node s, Node p, Node o) {
- * RepositoryResult<Statement> result; try { result =
- * conn.getStatements(vf.asResource(s), vf.asURI(p), vf.asValue(o), false,
- * context); } catch (RepositoryException e) { throw new
- * RuntimeException(e); } return new AGTripleIterator(result); }
- */
-
@Override
public BulkUpdateHandler getBulkUpdateHandler() {
return new AGBulkUpdateHandler(this);
}
- /*
- * @Override public Capabilities getCapabilities() { // TODO Auto-generated
- * method stub return null; }
- *
- * @Override public GraphEventManager getEventManager() { // TODO
- * Auto-generated method stub return null; }
- */
-
@Override
public PrefixMapping getPrefixMapping() {
return new AGPrefixMapping(this);
}
- /*
- * @Override public Reifier getReifier() { return reifier; }
- *
- * @Override public GraphStatisticsHandler getStatisticsHandler() { // TODO
- * Auto-generated method stub return null; }
- */
-
@Override
public TransactionHandler getTransactionHandler() {
return new AGTransactionHandler(this);
}
- /*
- * @Override public boolean isClosed() { // TODO Auto-generated method stub
- * return false; }
- *
- * @Override public boolean isEmpty() { // TODO Auto-generated method stub
- * return false; }
- *
- * @Override public boolean isIsomorphicWith(Graph g) { // TODO
- * Auto-generated method stub return false; }
- */
-
- @Override
- public QueryHandler queryHandler() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * @Override public int size() { // TODO deal with graphs bigger than int's.
- * int size; try { size = (int)conn.size(context); } catch
- * (RepositoryException e) { // TODO: proper exception to throw? throw new
- * RuntimeException(e); } return size; }
- *
-
- @Override
- public void add(Triple t) throws AddDeniedException {
- try {
- conn.add(vf.asResource(t.getSubject()), vf.asURI(t.getPredicate()),
- vf.asValue(t.getObject()), context);
- } catch (UnauthorizedException e) {
- throw new AddDeniedException(e.getMessage());
- } catch (RepositoryException e) {
- throw new RuntimeException(e);
- }
- }*/
-
@Override
public String toString() {
if (graphNode == null)
View
18 src/com/franz/agraph/jena/AGGraphMaker.java
@@ -41,8 +41,7 @@ public AGGraph getGraph() {
@Override
public AGGraph createGraph() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -58,26 +57,22 @@ public AGGraph createGraph(String uri, boolean strict) {
@Override
public ReificationStyle getReificationStyle() {
- // TODO Auto-generated method stub
- return null;
+ return ReificationStyle.Minimal;
}
@Override
public boolean hasGraph(String name) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public ExtendedIterator<String> listGraphs() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public AGGraph openGraph() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -93,8 +88,7 @@ public AGGraph openGraph(String uri, boolean strict) {
@Override
public void removeGraph(String name) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
}
View
29 src/com/franz/agraph/jena/AGInfGraph.java
@@ -34,26 +34,22 @@
@Override
public ExtendedIterator<Triple> find(Node subject, Node property,
Node object, Graph param) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Graph getDeductionsGraph() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Iterator<Derivation> getDerivation(Triple triple) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Node getGlobalProperty(Node property) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -68,44 +64,33 @@ public Reasoner getReasoner() {
@Override
public void prepare() {
- // TODO Auto-generated method stub
-
}
@Override
public void rebind() {
- // TODO Auto-generated method stub
-
}
@Override
public void rebind(Graph data) {
- // TODO Auto-generated method stub
-
}
@Override
public void reset() {
- // TODO Auto-generated method stub
-
}
@Override
public void setDerivationLogging(boolean logOn) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public boolean testGlobalProperty(Node property) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public ValidityReport validate() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
View
22 src/com/franz/agraph/jena/AGInfModel.java
@@ -34,14 +34,12 @@ public AGInfModel(AGReasoner reasoner, AGModel baseModel) {
@Override
public Model getDeductionsModel() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Iterator<Derivation> getDerivation(Statement statement) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -51,45 +49,35 @@ public Model getRawModel() {
@Override
public Reasoner getReasoner() {
- // TODO Auto-generated method stub
return reasoner;
}
@Override
public StmtIterator listStatements(Resource subject, Property predicate,
RDFNode object, Model posit) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public void prepare() {
- // TODO Auto-generated method stub
-
}
@Override
public void rebind() {
- // TODO Auto-generated method stub
-
}
@Override
public void reset() {
- // TODO Auto-generated method stub
-
}
@Override
public void setDerivationLogging(boolean logOn) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public ValidityReport validate() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
View
26 src/com/franz/agraph/jena/AGPrefixMapping.java
@@ -31,8 +31,7 @@ AGGraph getGraph() {
@Override
public String expandPrefix(String prefixed) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -81,26 +80,22 @@ public String getNsURIPrefix(String uri) {
@Override
public PrefixMapping lock() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public String qnameFor(String uri) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public PrefixMapping removeNsPrefix(String prefix) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public boolean samePrefixMappingAs(PrefixMapping other) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -115,26 +110,23 @@ public PrefixMapping setNsPrefix(String prefix, String uri) {
@Override
public PrefixMapping setNsPrefixes(PrefixMapping other) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public PrefixMapping setNsPrefixes(Map<String, String> map) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public String shortForm(String uri) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public PrefixMapping withDefaultMappings(PrefixMapping map) {
- // TODO Auto-generated method stub
return null;
+ //throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
}
View
15 src/com/franz/agraph/jena/AGQueryExecution.java
@@ -38,8 +38,7 @@ public AGQueryExecution(AGQuery query, AGModel model) {
@Override
public void abort() {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -113,26 +112,22 @@ public ResultSet execSelect() {
@Override
public Context getContext() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Dataset getDataset() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public void setFileManager(FileManager fm) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public void setInitialBinding(QuerySolution binding) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
}
View
12 src/com/franz/agraph/jena/AGQuerySolution.java
@@ -29,8 +29,7 @@ public AGQuerySolution(BindingSet bs, AGModel model) {
@Override
public boolean contains(String varName) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -40,20 +39,17 @@ public RDFNode get(String varName) {
@Override
public Literal getLiteral(String varName) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Resource getResource(String varName) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Iterator<String> varNames() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
View
21 src/com/franz/agraph/jena/AGReasoner.java
@@ -20,7 +20,7 @@
@Override
public void addDescription(Model configSpec, Resource base) {
- // TODO Auto-generated method stub
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@@ -34,44 +34,39 @@ public AGInfGraph bind(Graph data) throws ReasonerException {
@Override
public Reasoner bindSchema(Graph tbox) throws ReasonerException {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Reasoner bindSchema(Model tbox) throws ReasonerException {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Capabilities getGraphCapabilities() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Model getReasonerCapabilities() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public void setDerivationLogging(boolean logOn) {
- // TODO Auto-generated method stub
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public void setParameter(Property parameterUri, Object value) {
- // TODO Auto-generated method stub
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public boolean supportsProperty(Property property) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
View
17 src/com/franz/agraph/jena/AGResultSet.java
@@ -31,20 +31,17 @@ public AGResultSet(TupleQueryResult result, AGModel model) {
@Override
public Model getResourceModel() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public List<String> getResultVars() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public int getRowNumber() {
- // TODO Auto-generated method stub
- return 0;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -71,19 +68,17 @@ public QuerySolution next() {
@Override
public Binding nextBinding() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public QuerySolution nextSolution() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public void remove() {
- // TODO Auto-generated method stub
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
View
2  src/com/franz/agraph/jena/AGTransactionHandler.java
@@ -48,7 +48,7 @@ public void commit() {
@Override
public Object executeInTransaction(Command c) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
View
7 src/com/franz/agraph/jena/AGUnsupportedOperation.java
@@ -0,0 +1,7 @@
+package com.franz.agraph.jena;
+
+public class AGUnsupportedOperation {
+
+ public static final String message = "This method is not currently supported.";
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.