@Override public void setNamespace(String prefix, String uri) { try { nsMappings.setMapping(prefix, uri); } catch (NamespaceException e) { // ignore } }
public DefaultNamePathResolver(NamespaceRegistry registry) { this(new RegistryNamespaceResolver(registry)); }
public DefaultNamePathResolver(Session session) { this(new SessionNamespaceResolver(session), ((session instanceof IdentifierResolver)? (IdentifierResolver) session : null), false); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the prefix to namespace * URL mapping that was provided in the constructor of this repository * service. */ public Map<String, String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefixToURIMapping(); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the namespace URI for the * given <code>prefix</code>. */ public String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getURI(prefix); }
public String getNamespaceURI(String prefix) { try { return namespaceResolver.getURI(prefix); } catch (NamespaceException e) { throw new RuntimeException(e); } } };
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then return the namespace prefix for * the given <code>uri</code>. */ public String getNamespacePrefix(SessionInfo sessionInfo, String uri) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefix(uri); }
private HippoNamespaceMapping(NamespaceRegistry registry) { super(new RegistryNamespaceResolver(registry)); this.registry = registry; }
public DefaultNamePathResolver(Session session) { this(new SessionNamespaceResolver(session), ((session instanceof IdentifierResolver)? (IdentifierResolver) session : null), false); }
@Override public void setNamespace(String prefix, String uri) { try { nsMappings.setMapping(prefix, uri); } catch (NamespaceException e) { // ignore } }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the prefix to namespace * URL mapping that was provided in the constructor of this repository * service. */ public Map<String, String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefixToURIMapping(); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the namespace URI for the * given <code>prefix</code>. */ public String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getURI(prefix); }
public String getNamespaceURI(String prefix) { try { return namespaceResolver.getURI(prefix); } catch (NamespaceException e) { throw new RuntimeException(e); } } };
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then return the namespace prefix for * the given <code>uri</code>. */ public String getNamespacePrefix(SessionInfo sessionInfo, String uri) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefix(uri); }
public DefaultNamePathResolver(NamespaceRegistry registry) { this(new RegistryNamespaceResolver(registry)); }
/** * Creates a new nodetype writer based on a session * * @param out the underlying writer * @param s repository session * @param includeNS if <code>true</code> all used namespace declarations * are also written to the writer */ public CompactNodeTypeDefWriter(Writer out, Session s, boolean includeNS) { this(out, new SessionNamespaceResolver(s), new DefaultNamePathResolver(s), includeNS); }
/** * {@inheritDoc} */ public NamespaceResolver getNamespaceResolver() { return new RegistryNamespaceResolver(context.getNamespaceRegistry()); }
/** * Creates a new nodetype writer based on a session * * @param out the underlying writer * @param s repository session * @param includeNS if <code>true</code> all used namespace declarations * are also written to the writer */ public CompactNodeTypeDefWriter(Writer out, Session s, boolean includeNS) { this(out, new SessionNamespaceResolver(s), new DefaultNamePathResolver(s), includeNS); }
/** * {@inheritDoc} */ public NamespaceResolver getNamespaceResolver() { return new RegistryNamespaceResolver(context.getNamespaceRegistry()); }
/** * Create a new instance of this class. * * @param cc cluster config * @param repositoryHome repository home */ public SimpleClusterContext(ClusterConfig cc, File repositoryHome) { this.cc = cc; this.repositoryHome = repositoryHome; nsResolver = new RegistryNamespaceResolver(new SimpleNamespaceRegistry()); }