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/TokenContentSpec.java
package com.ctc.wstx.dtd; import com.ctc.wstx.cfg.ErrorConsts; import com.ctc.wstx.util.PrefixedName; /** * Content specification that defines content model consisting of just * one allowed element. In addition to the allowed element, spec can have * optional arity ("*", "+", "?") marker. */ public class TokenContentSpec extends ContentSpec { final static TokenContentSpec sDummy = new TokenContentSpec (' ', new PrefixedName("*", "*")); final PrefixedName mElemName; /* /////////////////////////////////////////////////// // Life-cycle /////////////////////////////////////////////////// */ public TokenContentSpec(char arity, PrefixedName elemName) { super(arity); mElemName = elemName; } public static TokenContentSpec construct(char arity, PrefixedName elemName) { return new TokenContentSpec(arity, elemName); } public static TokenContentSpec getDummySpec() { return sDummy; } /* /////////////////////////////////////////////////// // Public API /////////////////////////////////////////////////// */ @Override public boolean isLeaf() { return mArity == ' '; } public PrefixedName getName() { return mElemName; } @Override public StructValidator getSimpleValidator() { return new Validator(mArity, mElemName); } @Override public ModelNode rewrite() { TokenModel model = new TokenModel(mElemName); if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(new TokenModel(mElemName))); } return model; } @Override public String toString() { return (mArity == ' ') ? mElemName.toString() : (mElemName.toString() + mArity); } /* /////////////////////////////////////////////////// // Validator class: /////////////////////////////////////////////////// */ final static class Validator extends StructValidator { final char mArity; final PrefixedName mElemName; int mCount = 0; public Validator(char arity, PrefixedName elemName) { mArity = arity; mElemName = elemName; } /** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ @Override public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mElemName); } @Override public String tryToValidate(PrefixedName elemName) { if (!elemName.equals(mElemName)) { return "Expected element <"+mElemName+">"; } if (++mCount > 1 && (mArity == '?' || mArity == ' ')) { return "More than one instance of element <"+mElemName+">"; } return null; } @Override public String fullyValid() { switch (mArity) { case '*': case '?': return null; case '+': // need at least one (and multiples checked earlier) case ' ': if (mCount > 0) { return null; } return "Expected "+(mArity == '+' ? "at least one" : "") +" element <"+mElemName+">"; } // should never happen: throw new IllegalStateException(ErrorConsts.ERR_INTERNAL); } } }
⏎ com/ctc/wstx/dtd/TokenContentSpec.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, 9290👍, 0💬
Popular Posts:
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...
What Is javamail1_1_3.zip? javamail1_1_3.zip is the binary package of JavaMail API 1.1.3 in ZIP form...
What Is in Xerces-J-bin.2.12.2.zip? Xerces-J-bin.2.12.2.zip file is the distribution package ZIP fil...
JRE 5 sunjce_provider.jar is the JAR file for JRE 5 Sun JCE Provider, which provides implementations...
xml-commons External Source Code Files are provided in the source package file, xml-commons-external...