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, ≈47🔥, 0💬
Popular Posts:
JDK 17 jdk.jdeps.jmod is the JMOD file for JDK 17 JDeps tool, which can be invoked by the "jdeps" co...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
What is jxl.jar 2.6.12? jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12, which is a Java li...
How to compare performances of various XML parsers with the jaxp\SourceValidator.jav aprovided in th...
Apache Avalon began in 1999 as the Java Apache Server Framework and in late 2002 separated from the ...