Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JEuclid Core Source Code Files
JEuclid Source Code Files are provided
the
JEuclid GitHub Website.
You can browse JEuclid Source Code files below:
✍: FYIcenter
⏎ net/sourceforge/jeuclid/elements/support/NamespaceContextAdder.java
package net.sourceforge.jeuclid.elements.support;
import java.util.Collections;
import java.util.Iterator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
/**
* Chainable implementation of a {@link NamespaceContext}.
*
* @version $Revision$
*/
public class NamespaceContextAdder implements NamespaceContext {
private final String namespacePrefix;
private final String namespaceURI;
private final NamespaceContext delegateContext;
/**
* Create a new NamespaceAdder. The delegate context will be called if the
* namespace to be checked is not the namespace given in this adder. If the
* delegate is null, default values will be returned.
*
* @param ns
* namespace prefix.
* @param nsuri
* namespace URI
* @param delegate
* delegate {@link NamespaceContext}
*/
public NamespaceContextAdder(@Nonnull final String ns,
@Nonnull final String nsuri,
@Nullable final NamespaceContext delegate) {
this.namespacePrefix = ns;
this.namespaceURI = nsuri;
this.delegateContext = delegate;
}
/** {@inheritDoc} */
public String getNamespaceURI(final String prefix) {
String retVal;
if (this.namespacePrefix.equals(prefix)) {
retVal = this.namespaceURI;
} else if (this.delegateContext == null) {
retVal = XMLConstants.NULL_NS_URI;
} else {
retVal = this.delegateContext.getNamespaceURI(prefix);
}
return retVal;
}
/** {@inheritDoc} */
public String getPrefix(final String uri) {
String retVal;
if (this.namespaceURI.equals(uri)) {
retVal = this.namespacePrefix;
} else if (this.delegateContext == null) {
retVal = "";
} else {
retVal = this.delegateContext.getPrefix(uri);
}
return retVal;
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
public Iterator<String> getPrefixes(final String uri) {
Iterator<String> retVal;
if (this.namespaceURI.equals(uri)) {
retVal = Collections.singleton(this.namespacePrefix).iterator();
} else if (this.delegateContext == null) {
retVal = Collections.EMPTY_LIST.iterator();
} else {
retVal = this.delegateContext.getPrefixes(uri);
}
return retVal;
}
}
⏎ net/sourceforge/jeuclid/elements/support/NamespaceContextAdder.java
Or download all of them as a single archive file:
File name: jeuclid-core-3.1.14-fyi.zip File size: 325716 bytes Release date: 2019-02-24 Download
⇒ Using JEuclid 3.1.9 on macOS
⇐ Download and Install jeuclid-core-3.1.14.jar
2025-08-15, ≈73🔥, 0💬
Popular Posts:
The JMX technology provides the tools for building distributed, Web-based, modular and dynamic solut...
Rhino JavaScript Java Library is an open-source implementation of JavaScript written entirely in Jav...
JDK 11 jdk.hotspot.agent.jmod is the JMOD file for JDK 11 Hotspot Agent module. JDK 11 Hotspot Agent...
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
JDK 11 jdk.crypto.mscapi.jmod is the JMOD file for JDK 11 Crypto MSCAPI module. JDK 11 Crypto MSCAPI...