/** * Binds the given namespace as default namespace. * * @param namespaceUri the namespace uri */ public void bindDefaultNamespaceUri(String namespaceUri) { bindNamespaceUri(XMLConstants.DEFAULT_NS_PREFIX, namespaceUri); }
/** * Binds the given namespace as default namespace. * * @param namespaceUri the namespace uri */ public void bindDefaultNamespaceUri(String namespaceUri) { bindNamespaceUri(XMLConstants.DEFAULT_NS_PREFIX, namespaceUri); }
/** * Adds mapping between prefix and namespace. * @param prefix * @param namespace * @return */ public MessageValidator addNamespaceMapping(String prefix, String namespace) { namespaceContext.bindNamespaceUri(prefix, namespace); return this; }
/** * Binds the given prefix to the given namespaces. * * @see SimpleNamespaceContext#bindNamespaceUri(String,String) */ public final void startPrefixMapping(String prefix, String uri) { namespaceContext.bindNamespaceUri(prefix, uri); }
/** * Binds the given namespace as default namespace. * * @param namespaceUri the namespace uri */ public void bindDefaultNamespaceUri(String namespaceUri) { bindNamespaceUri(XMLConstants.DEFAULT_NS_PREFIX, namespaceUri); }
/** * Sets the bindings for this namespace context. The supplied map must consist of string key value pairs. * * @param bindings the bindings */ public void setBindings(Map<String, String> bindings) { for (Map.Entry<String, String> entry : bindings.entrySet()) { bindNamespaceUri(entry.getKey(), entry.getValue()); } }
/** * Sets the bindings for this namespace context. The supplied map must consist of string key value pairs. * * @param bindings the bindings */ public void setBindings(Map<String, String> bindings) { for (Map.Entry<String, String> entry : bindings.entrySet()) { bindNamespaceUri(entry.getKey(), entry.getValue()); } }
/** * Sets the bindings for this namespace context. The supplied map must consist of string key value pairs. * * @param bindings the bindings */ public void setBindings(Map<String, String> bindings) { for (Map.Entry<String, String> entry : bindings.entrySet()) { bindNamespaceUri(entry.getKey(), entry.getValue()); } }
private void startPrefixMapping(String prefix, String namespace) throws SAXException { if (!namespaceContext.getNamespaceURI(prefix).equals(namespace)) { getContentHandler().startPrefixMapping(prefix, namespace); namespaceContext.bindNamespaceUri(prefix, namespace); } }
private static void addNamespaceAnnotations(AnnotatedElement annotatedElement, SimpleNamespaceContext namespaceContext) { if (annotatedElement.isAnnotationPresent(Namespaces.class)) { Namespaces namespacesAnn = annotatedElement.getAnnotation(Namespaces.class); for (Namespace namespaceAnn : namespacesAnn.value()) { namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } } if (annotatedElement.isAnnotationPresent(Namespace.class)) { Namespace namespaceAnn = annotatedElement.getAnnotation(Namespace.class); namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } }
private static void addNamespaceAnnotations(AnnotatedElement annotatedElement, SimpleNamespaceContext namespaceContext) { if (annotatedElement.isAnnotationPresent(Namespaces.class)) { Namespaces namespacesAnn = annotatedElement.getAnnotation(Namespaces.class); for (Namespace namespaceAnn : namespacesAnn.value()) { namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } } if (annotatedElement.isAnnotationPresent(Namespace.class)) { Namespace namespaceAnn = annotatedElement.getAnnotation(Namespace.class); namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } }
private static void addNamespaceAnnotations(AnnotatedElement annotatedElement, SimpleNamespaceContext namespaceContext) { if (annotatedElement.isAnnotationPresent(Namespaces.class)) { Namespaces namespacesAnn = annotatedElement.getAnnotation(Namespaces.class); for (Namespace namespaceAnn : namespacesAnn.value()) { namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } } if (annotatedElement.isAnnotationPresent(Namespace.class)) { Namespace namespaceAnn = annotatedElement.getAnnotation(Namespace.class); namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } }
private static void addNamespaceAnnotations(AnnotatedElement annotatedElement, SimpleNamespaceContext namespaceContext) { if (annotatedElement.isAnnotationPresent(Namespaces.class)) { Namespaces namespacesAnn = annotatedElement.getAnnotation(Namespaces.class); for (Namespace namespaceAnn : namespacesAnn.value()) { namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } } if (annotatedElement.isAnnotationPresent(Namespace.class)) { Namespace namespaceAnn = annotatedElement.getAnnotation(Namespace.class); namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri()); } }
simpleNamespaceContext.bindNamespaceUri(binding.getKey(), binding.getValue());