/** @see org.apache.jena.shared.PrefixMapping#lock() */ @Override public PrefixMapping lock() { pmapLocal.lock() ; return this; }
@Override public PrefixMapping lock() { return this.prefixes.lock(); }
@Override public PrefixMapping lock() { getPrefixMapping().lock(); return this; }
@Override public PrefixMapping lock() { getPrefixMapping().lock(); return this; }
/** * Return a read-only graph that has the same data (RDF triples) as the one given, but has a * prefix mapping that only includes "in use" prefixes as calculated by * {@link #calcInUsePrefixMapping(Graph, PrefixMapping)}. * <p> * The prefix mappings of the two graphs are not connected. * Later changes to the prefix mapping of the original graph are not reflected in the returned graph. * Modifications to the triples contained in the underlying graph are reflected. */ public static Graph graphInUsePrefixMapping(Graph graph) { final PrefixMapping prefixMapping = calcInUsePrefixMapping(graph) ; prefixMapping.lock() ; Graph graph2 = new WrappedGraph(graph) { @Override public void performAdd(Triple triple) { throw new UnsupportedOperationException() ; } @Override public void performDelete(Triple triple) { throw new UnsupportedOperationException() ; } @Override public PrefixMapping getPrefixMapping() { return prefixMapping ; } } ; return graph2 ; }
/** * Return a read-only graph that has the same data (RDF triples) as the one given, but has a * prefix mapping that only includes "in use" prefixes as calculated by * {@link #calcInUsePrefixMapping(Graph, PrefixMapping)}. * <p> * The prefix mappings of the two graphs are not connected. * Later changes to the prefix mapping of the original graph are not reflected in the returned graph. * Modifications to the triples contained in the underlying graph are reflected. */ public static Graph graphInUsePrefixMapping(Graph graph) { final PrefixMapping prefixMapping = calcInUsePrefixMapping(graph) ; prefixMapping.lock() ; Graph graph2 = new WrappedGraph(graph) { @Override public void performAdd(Triple triple) { throw new UnsupportedOperationException() ; } @Override public void performDelete(Triple triple) { throw new UnsupportedOperationException() ; } @Override public PrefixMapping getPrefixMapping() { return prefixMapping ; } } ; return graph2 ; }
@Override public SecuredPrefixMapping lock() throws UpdateDeniedException, AuthenticationRequiredException { checkUpdate(); holder.getBaseItem().lock(); return holder.getSecuredItem(); }
public void testLock() { PrefixMapping A = getMapping(); assertSame( A, A.lock() ); /* */ try { A.setNsPrefix( "crisp", crispURI ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } /* */ try { A.setNsPrefixes( A ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } /* */ try { A.setNsPrefixes( new HashMap<String, String>() ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } /* */ try { A.removeNsPrefix( "toast" ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } } }
public void testLock() { PrefixMapping A = getMapping(); assertSame( A, A.lock() ); /* */ try { A.setNsPrefix( "crisp", crispURI ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } /* */ try { A.setNsPrefixes( A ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } /* */ try { A.setNsPrefixes( new HashMap<String, String>() ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } /* */ try { A.removeNsPrefix( "toast" ); fail( "mapping should be frozen" ); } catch (PrefixMapping.JenaLockedException e) { pass(); } } }