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:
Woodstox 6.4.0 - Source Code Files
Woodstox 6.4.0 Source Code Files are provided at the Woodstox GitHub Website.
You can download them from the "src/main/java" folder.
You can also browse Woodstox Source Code files below:
✍: FYIcenter
⏎ com/ctc/wstx/util/BaseNsContext.java
/* Woodstox XML processor
*
* Copyright (c) 2004 Tatu Saloranta, tatu.saloranta@iki.fi
*
* Licensed under the License specified in file LICENSE, included with
* the source code.
* You may not use this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ctc.wstx.util;
import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.stream.events.Namespace;
import com.ctc.wstx.cfg.ErrorConsts;
/**
* Abstract base class that defines extra features defined by most
* NamespaceContext implementations Wodstox uses.
*/
public abstract class BaseNsContext
implements NamespaceContext
{
/**
* This is the URI returned for default namespace, when it hasn't
* been explicitly declared; could be either "" or null.
*/
protected final static String UNDECLARED_NS_URI = "";
/*
/////////////////////////////////////////////
// NamespaceContext API
/////////////////////////////////////////////
*/
@Override
public final String getNamespaceURI(String prefix)
{
/* First the known offenders; invalid args, 2 predefined xml namespace
* prefixes
*/
if (prefix == null) {
throw new IllegalArgumentException(ErrorConsts.ERR_NULL_ARG);
}
if (prefix.length() > 0) {
if (prefix.equals(XMLConstants.XML_NS_PREFIX)) {
return XMLConstants.XML_NS_URI;
}
if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
}
}
return doGetNamespaceURI(prefix);
}
@Override
public final String getPrefix(String nsURI)
{
/* First the known offenders; invalid args, 2 predefined xml namespace
* prefixes
*/
if (nsURI == null || nsURI.length() == 0) {
throw new IllegalArgumentException("Illegal to pass null/empty prefix as argument.");
}
if (nsURI.equals(XMLConstants.XML_NS_URI)) {
return XMLConstants.XML_NS_PREFIX;
}
if (nsURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
return XMLConstants.XMLNS_ATTRIBUTE;
}
return doGetPrefix(nsURI);
}
@Override
public final Iterator<String> getPrefixes(String nsURI)
{
/* First the known offenders; invalid args, 2 predefined xml namespace
* prefixes
*/
if (nsURI == null || nsURI.length() == 0) {
throw new IllegalArgumentException("Illegal to pass null/empty prefix as argument.");
}
if (nsURI.equals(XMLConstants.XML_NS_URI)) {
return DataUtil.singletonIterator(XMLConstants.XML_NS_PREFIX);
}
if (nsURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
return DataUtil.singletonIterator(XMLConstants.XMLNS_ATTRIBUTE);
}
return doGetPrefixes(nsURI);
}
/*
/////////////////////////////////////////////
// Extended API
/////////////////////////////////////////////
*/
public abstract Iterator<Namespace> getNamespaces();
/**
* Method called by the matching start element class to
* output all namespace declarations active in current namespace
* scope, if any.
*/
public abstract void outputNamespaceDeclarations(Writer w) throws IOException;
public abstract void outputNamespaceDeclarations(XMLStreamWriter w) throws XMLStreamException;
/*
/////////////////////////////////////////////////
// Template methods sub-classes need to implement
/////////////////////////////////////////////////
*/
public abstract String doGetNamespaceURI(String prefix);
public abstract String doGetPrefix(String nsURI);
public abstract Iterator<String> doGetPrefixes(String nsURI);
}
⏎ com/ctc/wstx/util/BaseNsContext.java
Or download all of them as a single archive file:
File name: woodstox-core-6.4.0-fyi.zip File size: 552992 bytes Release date: 2022-10-25 Download
⇒ woodstox-core-6.4.0.jar - Woodstox Core 6.4.0
⇐ What Is Woodstox XML Processing
2023-01-29, ≈45🔥, 0💬
Popular Posts:
What Is fop.jar? I got it from the fop-2.7-bin.zip. fop.jar in fop-2.7-bin.zip is the JAR file for F...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
JRE 8 deploy.jar is the JAR file for JRE 8 Java Control Panel and other deploy tools. JRE (Java Runt...
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...
How to display types defined in an XML Schema file with the xs\QueryXS.java provided in the Apache X...