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/api/EmptyElementHandler.java
package com.ctc.wstx.api;
import java.util.Set;
import java.util.TreeSet;
/**
* Optional handler used to determine if a specific empty element (by name) should
* be allowed to use the self-closing syntax instead of having a separate end tag.
*
* @since 4.1
*/
public interface EmptyElementHandler
{
/**
* @param prefix The element's namespace prefix, null if not set
* @param localName The element's local name
* @param nsURI The elements's namespace URI, null if not set
* @param allowEmpty The allow empty setting specified by the caller.
* @return True if the empty element can be self-closing. False if a separate end tag should be written.
*/
public boolean allowEmptyElement(String prefix, String localName, String nsURI, boolean allowEmpty);
/**
* Handler that uses a Set of Strings. If the local part of the element's QName is contained
* in the Set the element is allowed to be empty.
*<p>
* Users of this class are encouraged to use a {@link TreeSet} with the {@link String#CASE_INSENSITIVE_ORDER}
* comparator if case-insensitive comparison is needed (like when dealing with HTML tags).
*/
public static class SetEmptyElementHandler
implements EmptyElementHandler
{
final protected Set<String> mEmptyElements;
public SetEmptyElementHandler(Set<String> emptyElements)
{
mEmptyElements = emptyElements;
}
@Override
public boolean allowEmptyElement(String prefix, String localName, String nsURI, boolean allowEmpty)
{
return mEmptyElements.contains(localName);
}
}
/**
* HTML specific empty element handler.
* Extends the {@link SetEmptyElementHandler} and configures
* the HTML elements that must be self-closing according to the W3C:
* http://www.w3.org/TR/html4/index/elements.html
*<p>
* Note that element name comparison is case-insensitive as required
* by HTML specification.
*/
public static class HtmlEmptyElementHandler
extends SetEmptyElementHandler
{
private final static HtmlEmptyElementHandler sInstance = new HtmlEmptyElementHandler();
public static HtmlEmptyElementHandler getInstance() { return sInstance; }
protected HtmlEmptyElementHandler()
{
super(new TreeSet<String>(String.CASE_INSENSITIVE_ORDER));
mEmptyElements.add("area");
mEmptyElements.add("base");
mEmptyElements.add("basefont");
mEmptyElements.add("br");
mEmptyElements.add("col");
mEmptyElements.add("frame");
mEmptyElements.add("hr");
mEmptyElements.add("input");
mEmptyElements.add("img");
mEmptyElements.add("isindex");
mEmptyElements.add("link");
mEmptyElements.add("meta");
mEmptyElements.add("param");
}
}
}
⏎ com/ctc/wstx/api/EmptyElementHandler.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, ≈70🔥, 0💬
Popular Posts:
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
Apache Commons CLI Source Code Files are provided in the source package file commons-cli-1.5.0-sourc. ..
Apache Log4j Core Implementation provides the functional components of the logging system. Users are...
How to merge two JAR files with "jar" commands? I am tired of specifying multiple JAR files in the c...
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...