/** * Retrieves the base namespace. * * @return The namespace of the base. */ public String getBase() { return base != null ? base : NSUtils.getDefaultDomain(); }
/** * Creates a new URI string within the default domain. * * @param name The name of the resource in the default domain. * @return The complete name for the resource. */ public String newName(String name) { if (base == null) return NSUtils.getDefaultDomain() + ":" + name; return base + name; }
/** * Get the namespace registered for a domain. This preferences the user registered domains, and * then falls back to the system registered domains if the domain was not found. * * @param domain The domain to find the namespace for. * @return The namespace registered for the domain, or <code>null</code> if not found. */ private String getNamespace(String domain) { String ns = namespaces.get(domain); if (ns != null) return ns; if (domain.length() == 0) return getBase(); return NSUtils.getRegisteredNamespace(domain); }