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/ArgUtil.java
package com.ctc.wstx.util;
/**
* Simple static utility class that contains (static) utility methods useful
* when parsing non-typesafe arguments (String-only configuration, command
* line args).
*/
public final class ArgUtil
{
private ArgUtil() { }
public static boolean convertToBoolean(String prop, Object value)
{
if (value == null) {
return false;
}
if (value instanceof Boolean) {
return ((Boolean) value).booleanValue();
}
if (value instanceof String) {
String str = (String) value;
if (str.equalsIgnoreCase("false")) {
return false;
}
if (str.equalsIgnoreCase("true")) {
return true;
}
throw new IllegalArgumentException("Invalid String value for property '"+prop+"': expected Boolean value.");
}
throw new IllegalArgumentException("Invalid value type ("+value.getClass()+") for property '"+prop+"': expected Boolean value.");
}
public static int convertToInt(String prop, Object value, int minValue)
{
int i;
if (value == null) {
i = 0;
} else if (value instanceof Number) {
i = ((Number) value).intValue();
} else if (value instanceof String) {
try {
i = Integer.parseInt((String) value);
} catch (NumberFormatException nex) {
throw new IllegalArgumentException("Invalid String value for property '"+prop+"': expected a number (Integer).");
}
} else {
throw new IllegalArgumentException("Invalid value type ("+value.getClass()+") for property '"+prop+"': expected Integer value.");
}
if (i < minValue) {
throw new IllegalArgumentException("Invalid numeric value ("+i
+") for property '"+prop
+"': minimum is "+minValue+".");
}
return i;
}
public static long convertToLong(String prop, Object value, long minValue)
{
long i;
if (value == null) {
i = 0;
} else if (value instanceof Number) {
i = ((Number) value).longValue();
} else if (value instanceof String) {
try {
i = Long.parseLong((String) value);
} catch (NumberFormatException nex) {
throw new IllegalArgumentException("Invalid String value for property '"+prop+"': expected a number (Long).");
}
} else {
throw new IllegalArgumentException("Invalid value type ("+value.getClass()+") for property '"+prop+"': expected Long value.");
}
if (i < minValue) {
throw new IllegalArgumentException("Invalid numeric value ("+i
+") for property '"+prop
+"': minimum is "+minValue+".");
}
return i;
}
}
⏎ com/ctc/wstx/util/ArgUtil.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 JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...
How to download and install xml-commons External Source Package? The source package contains Java so...
What Is jaxb-api-2.1.6.jar? Java Architecture for XML Binding (JAXB) is a Java API that allows Java ...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
What is the sax\Counter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 inst...