@Test( expected = NamespaceException.class ) public void shouldNotAllowUnregisteredUri() throws Exception { registry.getPrefix("bogus"); }
@Override public String getPrefix( String uri ) throws NamespaceException, RepositoryException { checkSession(); if (behavior == Behavior.WORKSPACE) { String prefix = STANDARD_BUILT_IN_PREFIXES_BY_NAMESPACE.get(uri); if (prefix != null) return prefix; } String prefix = registry.getPrefixForNamespaceUri(uri, false); if (prefix == null) { throw new NamespaceException(JcrI18n.noNamespaceWithUri.text(uri)); } return prefix; }
JcrNamespaceRegistry implements org.modeshape.jcr.api.NamespaceRegistry { @Override public String getPrefix( String uri ) throws NamespaceException, RepositoryException { checkSession(); if (behavior == Behavior.WORKSPACE) { String prefix = STANDARD_BUILT_IN_PREFIXES_BY_NAMESPACE.get(uri); if (prefix != null) return prefix; } String prefix = registry.getPrefixForNamespaceUri(uri, false); if (prefix == null) { throw new NamespaceException(JcrI18n.noNamespaceWithUri.text(uri)); } return prefix; } }
JcrNamespaceRegistry implements org.modeshape.jcr.api.NamespaceRegistry { @Override public String getPrefix( String uri ) throws NamespaceException, RepositoryException { checkSession(); if (behavior == Behavior.WORKSPACE) { String prefix = STANDARD_BUILT_IN_PREFIXES_BY_NAMESPACE.get(uri); if (prefix != null) return prefix; } String prefix = registry.getPrefixForNamespaceUri(uri, false); if (prefix == null) { throw new NamespaceException(JcrI18n.noNamespaceWithUri.text(uri)); } return prefix; } protected  JcrNamespaceRegistry( NamespaceRegistry workspaceRegistry,
                                    JcrSession session );   JcrNamespaceRegistry( Behavior behavior,
                          NamespaceRegistry localRegistry,
                          NamespaceRegistry workspaceRegistry,
                          JcrSession session ); }
JcrNamespaceRegistry implements org.modeshape.jcr.api.NamespaceRegistry { @Override public String getPrefix( String uri ) throws NamespaceException, RepositoryException { checkSession(); if (behavior == Behavior.WORKSPACE) { String prefix = STANDARD_BUILT_IN_PREFIXES_BY_NAMESPACE.get(uri); if (prefix != null) return prefix; } String prefix = registry.getPrefixForNamespaceUri(uri, false); if (prefix == null) { throw new NamespaceException(JcrI18n.noNamespaceWithUri.text(uri)); } return prefix; } protected  JcrNamespaceRegistry( NamespaceRegistry workspaceRegistry,
                                    JcrSession session );   JcrNamespaceRegistry( Behavior behavior,
                          NamespaceRegistry localRegistry,
                          NamespaceRegistry workspaceRegistry,
                          JcrSession session ); @Override String getPrefix( String uri ); @Override String[] getPrefixes(); @Override String getURI( String prefix ); @Override String[] getURIs(); @Override boolean isRegisteredPrefix( String prefix ); @Override boolean isRegisteredUri( String uri ); @Override synchronized void registerNamespace( String prefix,
                                                String uri ); @Override synchronized void unregisterNamespace( String prefix ); @Override String registerNamespace( String uri ); @Override String toString(); }
JcrNamespaceRegistry implements org.modeshape.jcr.api.NamespaceRegistry { @Override public String getPrefix( String uri ) throws NamespaceException, RepositoryException { checkSession(); if (behavior == Behavior.WORKSPACE) { String prefix = STANDARD_BUILT_IN_PREFIXES_BY_NAMESPACE.get(uri); if (prefix != null) return prefix; } String prefix = registry.getPrefixForNamespaceUri(uri, false); if (prefix == null) { throw new NamespaceException(JcrI18n.noNamespaceWithUri.text(uri)); } return prefix; } protected  JcrNamespaceRegistry( NamespaceRegistry workspaceRegistry,
                                    JcrSession session );   JcrNamespaceRegistry( Behavior behavior,
                          NamespaceRegistry localRegistry,
                          NamespaceRegistry workspaceRegistry,
                          JcrSession session ); @Override String getPrefix( String uri ); @Override String[] getPrefixes(); @Override String getURI( String prefix ); @Override String[] getURIs(); @Override boolean isRegisteredPrefix( String prefix ); @Override boolean isRegisteredUri( String uri ); @Override synchronized void registerNamespace( String prefix,
                                                String uri ); @Override synchronized void unregisterNamespace( String prefix ); @Override String registerNamespace( String uri ); @Override String toString();  }