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:
JDK 11 java.xml.jmod - XML Module
JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module.
JDK 11 XML module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.xml.jmod.
JDK 11 XML module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 XML module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.xml.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ javax/xml/catalog/Normalizer.java
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.xml.catalog;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* The Normalizer is responsible for normalizing Public and System Identifiers
* as specified in section 6.2, 6.3 and 6.4 of the specification
* * <a
* href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html">
* XML Catalogs, OASIS Standard V1.1, 7 October 2005</a>.
*
* @since 9
*/
class Normalizer {
/**
* Normalize a public identifier in accordance with section 6.2 of the
* Catalog specification.
*
* <p>
* All strings of white space in public identifiers must be normalized to
* single space characters (#x20), and leading and trailing white space must
* be removed.
*
* @param publicId The unnormalized public identifier
*
* @return The normalized identifier
*/
static String normalizePublicId(String publicId) {
if (publicId == null) return null;
StringBuilder sb = new StringBuilder(publicId.length());
char last = 'a';
for (char c : publicId.toCharArray()) {
//skip beginning and duplicate space
if ((c == ' ') && (sb.length() == 0 || last == ' ')) {
continue;
}
//replace whitespace with space
if (c == '\t' || c == '\r' || c == '\n') {
if (last != ' ') {
sb.append(' ');
last = ' ';
}
} else {
sb.append(c);
last = c;
}
}
//remove the last space
if (last == ' ') {
sb.deleteCharAt(sb.length() - 1);
}
return sb.toString();
}
/**
* Encode a public identifier as a "publicid" URN.
*
* @param publicId The unnormalized public identifier
*
* @return The normalized identifier
* @throws CatalogException if encoding failed
*/
static String encodeURN(String publicId) {
String urn = normalizePublicId(publicId);
try {
urn = URLEncoder.encode(urn, "UTF-8");
urn = urn.replace("::", ";");
urn = urn.replace("//", ":");
} catch (UnsupportedEncodingException ex) {
CatalogMessages.reportRunTimeError(CatalogMessages.ERR_OTHER, ex);
}
return Util.URN + urn;
}
/**
* Decode a "publicid" URN into a public identifier.
*
* @param urn The urn:publicid: URN
*
* @return The normalized identifier
* @throws CatalogException if decoding failed
*/
static String decodeURN(String urn) {
String publicId;
if (urn != null && urn.startsWith(Util.URN)) {
publicId = urn.substring(13);
} else {
return urn;
}
try {
publicId = publicId.replace(":", "//");
publicId = publicId.replace(";", "::");
publicId = URLDecoder.decode(publicId, "UTF-8");
} catch (UnsupportedEncodingException ex) {
CatalogMessages.reportRunTimeError(CatalogMessages.ERR_OTHER, ex);
}
return publicId;
}
/**
* Perform character normalization on a URI reference.
*
* @param uriref The URI reference
* @return The normalized URI reference
*/
static String normalizeURI(String uriref) {
if (uriref == null) {
return null;
}
byte[] bytes;
uriref = uriref.trim();
try {
bytes = uriref.getBytes("UTF-8");
} catch (UnsupportedEncodingException uee) {
// this can't happen
return uriref;
}
StringBuilder newRef = new StringBuilder(bytes.length);
for (int count = 0; count < bytes.length; count++) {
int ch = bytes[count] & 0xFF;
if ((ch <= 0x20) // ctrl
|| (ch > 0x7F) // high ascii
|| (ch == 0x22) // "
|| (ch == 0x3C) // <
|| (ch == 0x3E) // >
|| (ch == 0x5C) // \
|| (ch == 0x5E) // ^
|| (ch == 0x60) // `
|| (ch == 0x7B) // {
|| (ch == 0x7C) // |
|| (ch == 0x7D) // }
|| (ch == 0x7F)) {
newRef.append("%").append(String.format("%02X", ch));
} else {
newRef.append((char) bytes[count]);
}
}
return newRef.toString().trim();
}
}
⏎ javax/xml/catalog/Normalizer.java
Or download all of them as a single archive file:
File name: java.xml-11.0.1-src.zip File size: 4876106 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.xml.crypto.jmod - XML Crypto Module
2020-08-25, ≈691🔥, 0💬
Popular Posts:
What Is poi-ooxml-3.5.jar? poi-ooxml-3.5.jar is one of the JAR files for Apache POI 3.5, which provi...
JDK 17 jdk.httpserver.jmod is the JMOD file for JDK 17 HTTP Server module. JDK 17 HTTP Server module...
Java Architecture for XML Binding (JAXB) is a Java API that allows Java developers to map Java class...
How to display XML element type information with the jaxp\TypeInfoWriter.java provided in the Apache...
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a s...