Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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/dtd/DTDIdRefsAttr.java
package com.ctc.wstx.dtd; import javax.xml.stream.Location; import javax.xml.stream.XMLStreamException; import com.ctc.wstx.io.WstxInputData; import com.ctc.wstx.sr.InputProblemReporter; import com.ctc.wstx.util.ElementId; import com.ctc.wstx.util.ElementIdMap; import com.ctc.wstx.util.PrefixedName; /** * Attribute class for attributes that contain multiple references * to elements that have matching identifier specified. */ public final class DTDIdRefsAttr extends DTDAttribute { /* /////////////////////////////////////////////////// // Life-cycle /////////////////////////////////////////////////// */ /** * Main constructor. */ public DTDIdRefsAttr(PrefixedName name, DefaultAttrValue defValue, int specIndex, boolean nsAware, boolean xml11) { super(name, defValue, specIndex, nsAware, xml11); } @Override public DTDAttribute cloneWith(int specIndex) { return new DTDIdRefsAttr(mName, mDefValue, specIndex, mCfgNsAware, mCfgXml11); } /* /////////////////////////////////////////////////// // Public API /////////////////////////////////////////////////// */ @Override public int getValueType() { return TYPE_IDREFS; } /* /////////////////////////////////////////////////// // Public API, validation /////////////////////////////////////////////////// */ @SuppressWarnings("cast") @Override public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize) throws XMLStreamException { /* Let's skip leading/trailing white space, even if we are not * to normalize visible attribute value. This allows for better * round-trip handling (no changes for physical value caller * gets), but still allows succesful validation. */ while (start < end && WstxInputData.isSpaceChar(cbuf[start])) { ++start; } // No id? if (start >= end) { return reportValidationProblem(v, "Empty IDREFS value"); } --end; // so that it now points to the last char // We now the first char is not a space by now... while (end > start && WstxInputData.isSpaceChar(cbuf[end])) { --end; } // Ok; now start points to first, end to last char (both inclusive) ElementIdMap m = v.getIdMap(); Location loc = v.getLocation(); String idStr = null; StringBuilder sb = null; while (start <= end) { // Ok, need to check char validity, and also calc hash code: char c = cbuf[start]; if (!WstxInputData.isNameStartChar(c, mCfgNsAware, mCfgXml11)) { return reportInvalidChar(v, c, "not valid as the first IDREFS character"); } int hash = (int) c; int i = start+1; for (; i <= end; ++i) { c = cbuf[i]; if (WstxInputData.isSpaceChar(c)) { break; } if (!WstxInputData.isNameChar(c, mCfgNsAware, mCfgXml11)) { return reportInvalidChar(v, c, "not valid as an IDREFS character"); } hash = (hash * 31) + (int) c; } // Ok, got the next id ref... ElementId id = m.addReferenced(cbuf, start, i - start, hash, loc, v.getElemName(), mName); // Can skip the trailing space char (if there was one) start = i+1; /* When normalizing, we can possibly share id String, or * alternatively, compose normalized String if multiple */ if (normalize) { if (idStr == null) { // first idref idStr = id.getId(); } else { if (sb == null) { sb = new StringBuilder(idStr); } idStr = id.getId(); sb.append(' '); sb.append(idStr); } } // Ok, any white space to skip? while (start <= end && WstxInputData.isSpaceChar(cbuf[start])) { ++start; } } if (normalize) { if (sb != null) { idStr = sb.toString(); } return idStr; } return null; } /** * Method called by the validator * to ask attribute to verify that the default it has (if any) is * valid for such type. *<p> * It's unlikely there will be default values... but just in case, * let's implement it properly. */ @Override public void validateDefault(InputProblemReporter rep, boolean normalize) throws XMLStreamException { String def = validateDefaultNames(rep, normalize); if (normalize) { mDefValue.setValue(def); } } }
⏎ com/ctc/wstx/dtd/DTDIdRefsAttr.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, 27221👍, 0💬
Popular Posts:
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.0.2? The if y...
JDK 11 jdk.xml.dom.jmod is the JMOD file for JDK 11 XML DOM module. JDK 11 XML DOM module compiled c...
What Is HttpComponents httpcore-4.4.6.jar? HttpComponents httpcore-4.4.6.jar is the JAR file for Apa...
JDK 11 jdk.jdi.jmod is the JMOD file for JDK 11 JDI (Java Debug Interface) tool. JDK 11 JDI tool com...
How to show the XML parsing flow with sax\DocumentTracer.java provided in the Apache Xerces package?...