rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
return model;
private void readElements(StringBuffer acc) throws IOException, XMLStreamException { char separator; // Parse first content particle skipWhitespace(); readContentParticle(acc); // End or separator skipWhitespace(); char c = readCh(); switch (c) { case ')': acc.append('...
if (validating && doctype != null) endElementValidationHook();
private void readEndElement() throws IOException, XMLStreamException { //System.err.println("readEndElement"); // pop element off stack String expected = (String) stack.removeLast(); require(expected); skipWhitespace(); require('>'); // Make element name available buf.setLength(0); buf....
char c = readCh();
int c = readCh();
private void readEntityDecl(boolean inExternalSubset) throws IOException, XMLStreamException { int flags = 0; // Check if parameter entity boolean peFlag = false; expandPE = false; requireWhitespace(); if (tryRead('%')) { peFlag = true; requireWhitespace(); } expandPE ...
if (c == '"' || c == '\'')
if (c == 0x22 || c == 0x27)
private void readEntityDecl(boolean inExternalSubset) throws IOException, XMLStreamException { int flags = 0; // Check if parameter entity boolean peFlag = false; expandPE = false; requireWhitespace(); if (tryRead('%')) { peFlag = true; requireWhitespace(); } expandPE ...
String value = readLiteral(flags | LIT_DISABLE_EREF);
String value = readLiteral(flags | LIT_DISABLE_EREF, true); int ai = value.indexOf('&'); while (ai != -1) { int sci = value.indexOf(';', ai); if (sci == -1) error("malformed reference in entity value", value); String ref = value.substring(ai + 1, sci); int[] cp = UnicodeReader.toCodePointArray(ref); if (cp.length == 0)...
private void readEntityDecl(boolean inExternalSubset) throws IOException, XMLStreamException { int flags = 0; // Check if parameter entity boolean peFlag = false; expandPE = false; requireWhitespace(); if (tryRead('%')) { peFlag = true; requireWhitespace(); } expandPE ...
private void readEnumeration(boolean isNames, StringBuffer acc)
private void readEnumeration(boolean isNames, StringBuffer acc, HashSet values)
private void readEnumeration(boolean isNames, StringBuffer acc) throws IOException, XMLStreamException { acc.append('('); // first token skipWhitespace(); acc.append(readNmtoken(isNames)); // subsequent tokens skipWhitespace(); while (!tryRead(')')) { require('|'); acc.appe...
acc.append(readNmtoken(isNames));
String token = readNmtoken(isNames); acc.append(token); values.add(token);
private void readEnumeration(boolean isNames, StringBuffer acc) throws IOException, XMLStreamException { acc.append('('); // first token skipWhitespace(); acc.append(readNmtoken(isNames)); // subsequent tokens skipWhitespace(); while (!tryRead(')')) { require('|'); acc.appe...
acc.append(readNmtoken(isNames));
token = readNmtoken(isNames); if (validating && values.contains(token)) error("duplicate token", token); acc.append(token); values.add(token);
private void readEnumeration(boolean isNames, StringBuffer acc) throws IOException, XMLStreamException { acc.append('('); // first token skipWhitespace(); acc.append(readNmtoken(isNames)); // subsequent tokens skipWhitespace(); while (!tryRead(')')) { require('|'); acc.appe...
char c;
int c;
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
ids.publicId = readLiteral(LIT_NORMALIZE | LIT_PUBID | flags);
ids.publicId = readLiteral(LIT_NORMALIZE | LIT_PUBID | flags, false);
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
if (c == '"' || c == '\'') ids.systemId = absolutize(input.systemId, readLiteral(flags));
if (c == 0x22 || c == 0x27) { String href = readLiteral(flags, false); ids.systemId = absolutize(input.systemId, href); }
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
ids.systemId = absolutize(input.systemId, readLiteral(flags));
String href = readLiteral(flags, false); ids.systemId = absolutize(input.systemId, href);
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
c = ids.publicId.charAt(i); if (c >= 'a' && c <= 'z')
char d = ids.publicId.charAt(i); if (d >= 'a' && d <= 'z')
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
if (c >= 'A' && c <= 'Z')
if (d >= 'A' && d <= 'Z')
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
if (" \r\n0123456789-' ()+,./:=?;!*#@$_%".indexOf(c) != -1)
if (" \r\n0123456789-' ()+,./:=?;!*#@$_%".indexOf(d) != -1)
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
"U+" + Integer.toHexString(c));
"U+" + Integer.toHexString(d));
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
if (ids.systemId != null)
if (ids.systemId != null && !inNotation)
private ExternalIds readExternalIds(boolean inNotation, boolean isSubset) throws IOException, XMLStreamException { char c; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; ExternalIds ids = new ExternalIds(); if (tryRead("PUBLIC")) { requireWhitespace(); ids.pub...
private String readLiteral(int flags)
private String readLiteral(int flags, boolean recognizePEs)
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim));
int delim = readCh(); if (delim != 0x27 && delim != 0x22) error("expected '\"' or \"'\"", "U+" + Integer.toHexString(delim));
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
char c = literalReadCh();
int c = literalReadCh(recognizePEs);
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
case '\n': case '\r':
case 0x0a: case 0x0d:
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
c = ' ';
c = 0x20;
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
case '\t':
case 0x09:
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
case '&':
case 0x26:
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
if (c == '#')
if (c == 0x23)
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
c = '&';
c = 0x26;
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
boolean hex = (c == 'x');
boolean hex = (c == 0x78);
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
c = ref[i];
char x = ref[i];
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
(c == '\n' || c == '\r')) c = ' '; else if ((flags & LIT_ATTRIBUTE) != 0 && c == '\t') c = ' '; literalBuf.append(c);
(x == 0x0a || x == 0x0d)) x = 0x20; else if ((flags & LIT_ATTRIBUTE) != 0 && x == 0x09) x = 0x20; literalBuf.append(x);
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
if (replaceERefs || (flags & LIT_NORMALIZE) > 0) {
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
(flags & LIT_ATTRIBUTE) != 0);
(flags & LIT_ATTRIBUTE) != 0, true);
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
else error("parser is configured not to replace entity " + "references"); }
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
case '<':
case 0x3c:
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
case '\uffff':
case -1:
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
literalBuf.append(c);
literalBuf.append(Character.toChars(c));
private String readLiteral(int flags) throws IOException, XMLStreamException { boolean saved = expandPE; char delim = readCh(); if (delim != '\'' && delim != '"') error("expected '\"' or \"'\"", new Character(delim)); literalBuf.setLength(0); if ((flags & LIT_DISABLE_PE) != 0) expandPE = ...
readPI();
private void readMarkupdecl(boolean inExternalSubset) throws IOException, XMLStreamException { boolean saved = expandPE; mark(1); require('<'); reset(); expandPE = false; if (tryRead(TEST_ELEMENT_DECL)) { expandPE = saved; readElementDecl(); } else if (tryRead(TEST_ATT...
readComment();
private void readMarkupdecl(boolean inExternalSubset) throws IOException, XMLStreamException { boolean saved = expandPE; mark(1); require('<'); reset(); expandPE = false; if (tryRead(TEST_ELEMENT_DECL)) { expandPE = saved; readElementDecl(); } else if (tryRead(TEST_ATT...
char c = readCh();
int c = readCh();
private void readMarkupdecl(boolean inExternalSubset) throws IOException, XMLStreamException { boolean saved = expandPE; mark(1); require('<'); reset(); expandPE = false; if (tryRead(TEST_ELEMENT_DECL)) { expandPE = saved; readElementDecl(); } else if (tryRead(TEST_ATT...
case '<':
case 0x3c:
private void readMarkupdecl(boolean inExternalSubset) throws IOException, XMLStreamException { boolean saved = expandPE; mark(1); require('<'); reset(); expandPE = false; if (tryRead(TEST_ELEMENT_DECL)) { expandPE = saved; readElementDecl(); } else if (tryRead(TEST_ATT...
case ']':
case 0x5d:
private void readMarkupdecl(boolean inExternalSubset) throws IOException, XMLStreamException { boolean saved = expandPE; mark(1); require('<'); reset(); expandPE = false; if (tryRead(TEST_ELEMENT_DECL)) { expandPE = saved; readElementDecl(); } else if (tryRead(TEST_ATT...
case '\uffff':
case -1:
private void readMarkupdecl(boolean inExternalSubset) throws IOException, XMLStreamException { boolean saved = expandPE; mark(1); require('<'); reset(); expandPE = false; if (tryRead(TEST_ELEMENT_DECL)) { expandPE = saved; readElementDecl(); } else if (tryRead(TEST_ATT...
expandPE = true;
expandPE = saved;
private void readMarkupdecl(boolean inExternalSubset) throws IOException, XMLStreamException { boolean saved = expandPE; mark(1); require('<'); reset(); expandPE = false; if (tryRead(TEST_ELEMENT_DECL)) { expandPE = saved; readElementDecl(); } else if (tryRead(TEST_ATT...
nmtokenBuf.setLength(0); char c = readCh(); if (isName) { if (!isNameStartCharacter(c)) error("not a name start character", "U+" + Integer.toHexString(c)); } else { if (!isNameCharacter(c)) error("not a name character", "U+" + Integer.toHexString(c)); } nmtokenBuf.append(c); do { mark(1); c = readCh(); switch (c) { cas...
return readNmtoken(isName, nmtokenBuf);
private String readNmtoken(boolean isName) throws IOException, XMLStreamException { nmtokenBuf.setLength(0); char c = readCh(); if (isName) { if (!isNameStartCharacter(c)) error("not a name start character", "U+" + Integer.toHexString(c)); } else { ...
if (validating) { ExternalIds notation = doctype.getNotation(notationName); if (notation != null) error("duplicate notation name", notationName); }
private void readNotationDecl(boolean inExternalSubset) throws IOException, XMLStreamException { requireWhitespace(); String notationName = readNmtoken(true); if (notationName.indexOf(':') != -1) error("illegal character ':' in notation name", notationName); requireWhitespace(); ExternalIds id...
private void readNotationType(StringBuffer acc)
private void readNotationType(StringBuffer acc, HashSet values)
private void readNotationType(StringBuffer acc) throws IOException, XMLStreamException { requireWhitespace(); require('('); readEnumeration(true, acc); }
readEnumeration(true, acc);
readEnumeration(true, acc, values);
private void readNotationType(StringBuffer acc) throws IOException, XMLStreamException { requireWhitespace(); require('('); readEnumeration(true, acc); }
private void readPI()
private void readPI(boolean inDTD)
private void readPI() throws IOException, XMLStreamException { boolean saved = expandPE; expandPE = false; piTarget = readNmtoken(true); if (piTarget.indexOf(':') != -1) error("illegal character in PI target", new Character(':')); if ("xml".equalsIgnoreCase(piTarget)) error("illegal PI ta...
if (inDTD) doctype.addPI(piTarget, piData);
private void readPI() throws IOException, XMLStreamException { boolean saved = expandPE; expandPE = false; piTarget = readNmtoken(true); if (piTarget.indexOf(':') != -1) error("illegal character in PI target", new Character(':')); if ("xml".equalsIgnoreCase(piTarget)) error("illegal PI ta...
if (":".equals(elementName)) error("XML Namespaces forbids names consisting of a single colon");
if (elementName.charAt(0) == ':' || elementName.charAt(elementName.length() - 1) == ':') error("not a QName", elementName);
private int readStartElement() throws IOException, XMLStreamException { //System.err.println("readStartElement"); // Read element name String elementName = readNmtoken(true); attrs.clear(); // Push namespace context if (namespaceAware) { if (":".equals(elementName)) error("X...
char c = readCh(); while (c != '/' && c != '>')
int c = readCh(); while (c != 0x2f && c != 0x3e)
private int readStartElement() throws IOException, XMLStreamException { //System.err.println("readStartElement"); // Read element name String elementName = readNmtoken(true); attrs.clear(); // Push namespace context if (namespaceAware) { if (":".equals(elementName)) error("X...
AttributeDecl decl = (AttributeDecl) entry.getValue();
private int readStartElement() throws IOException, XMLStreamException { //System.err.println("readStartElement"); // Read element name String elementName = readNmtoken(true); attrs.clear(); // Push namespace context if (namespaceAware) { if (":".equals(elementName)) error("X...
String base = getAttributeValue(XMLConstants.XML_NS_URI, "base"); bases.addFirst(base);
String uri = getAttributeValue(XMLConstants.XML_NS_URI, "base"); String base = getXMLBase(); bases.addFirst(absolutize(base, uri)); } if (namespaceAware) { int ci = elementName.indexOf(':'); if (ci != -1) { String prefix = elementName.substring(0, ci); String uri = getNamespaceURI(prefix); if (uri == null) error("unbo...
private int readStartElement() throws IOException, XMLStreamException { //System.err.println("readStartElement"); // Read element name String elementName = readNmtoken(true); attrs.clear(); // Push namespace context if (namespaceAware) { if (":".equals(elementName)) error("X...
case '>':
case 0x3e:
private int readStartElement() throws IOException, XMLStreamException { //System.err.println("readStartElement"); // Read element name String elementName = readNmtoken(true); attrs.clear(); // Push namespace context if (namespaceAware) { if (":".equals(elementName)) error("X...
case '/':
case 0x2f:
private int readStartElement() throws IOException, XMLStreamException { //System.err.println("readStartElement"); // Read element name String elementName = readNmtoken(true); attrs.clear(); // Push namespace context if (namespaceAware) { if (":".equals(elementName)) error("X...
String v = readLiteral(flags);
String v = readLiteral(flags, false);
private void readTextDecl() throws IOException, XMLStreamException { final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; requireWhitespace(); if (tryRead("version")) { readEq(); String v = readLiteral(flags); if ("1.0".equals(v)) input.xml11 = false;...
String enc = readLiteral(flags); if (!input.forceReader) input.setInputEncoding(enc);
String enc = readLiteral(flags, false);
private void readTextDecl() throws IOException, XMLStreamException { final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; requireWhitespace(); if (tryRead("version")) { readEq(); String v = readLiteral(flags); if ("1.0".equals(v)) input.xml11 = false;...
input.setInputEncoding(enc);
private void readTextDecl() throws IOException, XMLStreamException { final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; requireWhitespace(); if (tryRead("version")) { readEq(); String v = readLiteral(flags); if ("1.0".equals(v)) input.xml11 = false;...
char c = readCh(); if (c == '\uffff')
int c = readCh(); if (c == -1)
private void readUntil(String delim) throws IOException, XMLStreamException { int startLine = input.line; try { while (!tryRead(delim)) { char c = readCh(); if (c == '\uffff') throw new EOFException(); else if (c < 32 && c != 10 && c != 9 &&...
else if (c < 32 && c != 10 && c != 9 && c != 13) error("illegal XML character", Character.toString(c)); buf.append(c);
else if (input.xml11) { if (!isXML11Char(c) || isXML11RestrictedChar(c)) error("illegal XML 1.1 character", "U+" + Integer.toHexString(c)); } else if (!isChar(c)) error("illegal XML character", "U+" + Integer.toHexString(c)); buf.append(Character.toChars(c));
private void readUntil(String delim) throws IOException, XMLStreamException { int startLine = input.line; try { while (!tryRead(delim)) { char c = readCh(); if (c == '\uffff') throw new EOFException(); else if (c < 32 && c != 10 && c != 9 &&...
xmlVersion = readLiteral(flags);
xmlVersion = readLiteral(flags, false);
private void readXMLDecl() throws IOException, XMLStreamException { final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; requireWhitespace(); require("version"); readEq(); xmlVersion = readLiteral(flags); if ("1.0".equals(xmlVersion)) input.xml11 = false; else if (...
xmlEncoding = readLiteral(flags); if (!input.forceReader) input.setInputEncoding(xmlEncoding);
xmlEncoding = readLiteral(flags, false);
private void readXMLDecl() throws IOException, XMLStreamException { final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; requireWhitespace(); require("version"); readEq(); xmlVersion = readLiteral(flags); if ("1.0".equals(xmlVersion)) input.xml11 = false; else if (...
String standalone = readLiteral(flags);
String standalone = readLiteral(flags, false);
private void readXMLDecl() throws IOException, XMLStreamException { final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; requireWhitespace(); require("version"); readEq(); xmlVersion = readLiteral(flags); if ("1.0".equals(xmlVersion)) input.xml11 = false; else if (...
if (xmlEncoding != null) input.setInputEncoding(xmlEncoding);
private void readXMLDecl() throws IOException, XMLStreamException { final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; requireWhitespace(); require("version"); readEq(); xmlVersion = readLiteral(flags); if ("1.0".equals(xmlVersion)) input.xml11 = false; else if (...
char c = readCh(); while (c == '\uffff' && inputStack.size() > 1)
int c = readCh(); while (c == -1 && inputStack.size() > 1)
private void skipWhitespace() throws IOException, XMLStreamException { boolean white; do { mark(1); char c = readCh(); while (c == '\uffff' && inputStack.size() > 1) { popInput(); c = readCh(); } white = (c == ' ' || c == '\t' || c == ...
white = (c == ' ' || c == '\t' || c == '\n' || c == '\r');
white = (c == 0x20 || c == 0x09 || c == 0x0a || c == 0x0d);
private void skipWhitespace() throws IOException, XMLStreamException { boolean white; do { mark(1); char c = readCh(); while (c == '\uffff' && inputStack.size() > 1) { popInput(); c = readCh(); } white = (c == ' ' || c == '\t' || c == ...
char c = readCh();
int c = readCh();
private boolean tryRead(char delim) throws IOException, XMLStreamException { mark(1); char c = readCh(); if (delim != c) { reset(); return false; } return true; }
char c = readCh(); white = (c == ' ' || c == '\t' || c == '\n' || c == '\r');
int c = readCh(); while (c == -1 && inputStack.size() > 1) { popInput(); c = readCh(); } white = (c == 0x20 || c == 0x09 || c == 0x0a || c == 0x0d);
private boolean tryWhitespace() throws IOException, XMLStreamException { boolean white; boolean ret = false; do { mark(1); char c = readCh(); white = (c == ' ' || c == '\t' || c == '\n' || c == '\r'); if (white) ret = true; else if (c == '\uffff') ...
else if (c == '\uffff') { if (inputStack.size() > 1) popInput(); else throw new EOFException(); }
private boolean tryWhitespace() throws IOException, XMLStreamException { boolean white; boolean ret = false; do { mark(1); char c = readCh(); white = (c == ' ' || c == '\t' || c == '\n' || c == '\r'); if (white) ret = true; else if (c == '\uffff') ...
public abstract IntBuffer put (int b);
public IntBuffer put (IntBuffer src) { if (src == this) throw new IllegalArgumentException (); checkForOverflow(src.remaining ()); if (src.remaining () > 0) { int[] toPut = new int [src.remaining ()]; src.get (toPut); put (toPut); } return this; }
public abstract IntBuffer put (int b);
final public static IntBuffer wrap (int[] array, int offset, int length)
public static final IntBuffer wrap (int[] array, int offset, int length)
final public static IntBuffer wrap (int[] array, int offset, int length) { return new IntBufferImpl (array, 0, array.length, offset + length, offset, -1, false); }
if (ch instanceof FileChannelImpl) return newInputStream((FileChannelImpl) ch); return new ChannelInputStream(ch);
return VMChannels.newInputStream(ch);
public static InputStream newInputStream(ReadableByteChannel ch) { if (ch instanceof FileChannelImpl) return newInputStream((FileChannelImpl) ch); return new ChannelInputStream(ch); }
if (ch instanceof FileChannelImpl) return newOutputStream((FileChannelImpl) ch); return new ChannelOutputStream(ch);
return VMChannels.newOutputStream(ch);
public static OutputStream newOutputStream(WritableByteChannel ch) { if (ch instanceof FileChannelImpl) return newOutputStream((FileChannelImpl) ch); return new ChannelOutputStream(ch); }
menuBar.setOpaque(true);
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); menuBar.setBackground(defaults.getColor("MenuBar.background")); menuBar.setBorder(defaults.getBorder("MenuBar.border")); menuBar.setFont(defaults.getFont("MenuBar.font")); menuBar.setForeground(defaults.getCol...
LookAndFeelInfo(String name,
public LookAndFeelInfo(String name,
LookAndFeelInfo(String name, String clazz) { this.name = name; this.clazz = clazz; }
String getClassName() { return clazz; }
public String getClassName() { return clazz; }
String getClassName() { return clazz; }
String getName() { return name; }
public String getName() { return name; }
String getName() { return name; }
System.out.println("UIManager.getDim"); return new Dimension(200,100);
return (Dimension) getLookAndFeel().getDefaults().get(key);
public static Dimension getDimension(Object key) { System.out.println("UIManager.getDim"); return new Dimension(200,100); }
public Dimension preferredLayoutSize ( Container c ) { Dimension p = super.preferredLayoutSize(c); return p; }
public Dimension preferredLayoutSize(Container c) { Dimension menuBarSize; Dimension prefSize; Dimension containerSize = c.getSize(); Dimension contentPaneSize = contentPane.getPreferredSize(); if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getP...
public Dimension preferredLayoutSize ( Container c ) { Dimension p = super.preferredLayoutSize(c); return p; }
setBackground(UIManager.getColor("control"));
JRootPane() { setLayout(createRootLayout()); setBackground(UIManager.getColor("control")); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
System.out.println("Created ContentPane: " + p);
JComponent createContentPane() { JPanel p = new JPanel(); p.setName(this.getName()+".contentPane"); p.setLayout(new BorderLayout()); // p.setVisible(true); System.out.println("Created ContentPane: " + p); return p; }
System.out.println("created the glasspane: "+p);
Component createGlassPane() { JPanel p = new JPanel(); p.setName(this.getName()+".glassPane"); p.setLayout(new BorderLayout()); p.setVisible(false); System.out.println("created the glasspane: "+p); return p; }
l.setLayout(null);
JLayeredPane createLayeredPane() { JLayeredPane l = new JLayeredPane(); return l; }
{ menuBar = m; }
{ menuBar = m; getLayeredPane().add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER); }
void setJMenuBar(JMenuBar m) { menuBar = m; }
public FSEntryIterator(INode iNode) { lastBlockIndex = -1; blockIndex = 0; index=0; current = null; log.debug("FSEntryIterator()");
public FSEntryIterator(INode iNode)throws IOException { Ext2File directoryFile = new Ext2File(iNode); data = new byte[(int)directoryFile.getLength()]; directoryFile.read(0, data, 0, (int)directoryFile.getLength()); index = 0;
public FSEntryIterator(INode iNode) { //this.iNode = iNode; lastBlockIndex = -1; blockIndex = 0; //the byte index where the directory parsing has reached index=0; //the Ext2DirectoryRecord that has been read last current = null; log.debug("FSEntryIterator()"); }
log.debug("FSEntryIterator.hasNext()"); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false;
Ext2DirectoryRecord dr; do { if(index>=iNode.getSize()) return false;
public boolean hasNext() { log.debug("FSEntryIterator.hasNext()"); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( ...
blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=d...
dr = new Ext2DirectoryRecord(data, index, index); index+=dr.getRecLen(); } while(dr.getINodeNr()==0); current = dr; return true;
public boolean hasNext() { log.debug("FSEntryIterator.hasNext()"); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( ...
log.debug("FSEntryIterator.next()");
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem())...
dr.getName(), dr.getType() );
dr.getName(), dr.getType(), fs );
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem())...
throw new NoSuchElementException();
throw new NoSuchElementException("Root cause: "+e.getMessage());
public Object next() { log.debug("FSEntryIterator.next()"); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem())...
public Ext2Directory(INode iNode) {
public Ext2Directory(INode iNode, Ext2FileSystem fs) {
public Ext2Directory(INode iNode) { this.iNode=iNode; valid=true; }
this.fs = fs; log.setLevel(Level.DEBUG); if((iNode.getFlags() & Ext2Constants.EXT2_INDEX_FL)== 1) mode = Ext2FileSystem.RO; else mode = fs.getMode(); log.debug("directory size: "+iNode.getSize());
public Ext2Directory(INode iNode) { this.iNode=iNode; valid=true; }
throw new IOException("EXT2 implementation is currently readonly");
if(getMode()==Ext2FileSystem.RO) throw new IOException("Filesystem or directory is mounted read-only!"); INode newINode; Ext2DirectoryRecord dr; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Cons...
public FSEntry addDirectory(String name) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
throw new IOException("EXT2 implementation is currently readonly");
if(getMode()==Ext2FileSystem.RO) throw new IOException("Filesystem or directory is mounted read-only!"); INode newINode; Ext2DirectoryRecord dr; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Cons...
public FSEntry addFile(String name) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
public FSEntry getEntry(String name) {
public FSEntry getEntry(String name) throws IOException{
public FSEntry getEntry(String name) { //parse the directory and search for the file Iterator iterator=iterator(); while(iterator.hasNext()) { FSEntry entry = (FSEntry)iterator.next(); if(entry.getName().equals(name)) return entry; } return null; }
public Iterator iterator() {
public Iterator iterator() throws IOException {
public Iterator iterator() { log.debug("Ext2Directory.Iterator()"); return new FSEntryIterator(iNode); }
throw new IOException("EXT2 implementation is currently readonly");
if(getMode()==Ext2FileSystem.RO) throw new IOException("Filesystem or directory is mounted read-only!"); throw new IOException("remove not yet implemented");
public void remove(String name) throws IOException { throw new IOException("EXT2 implementation is currently readonly"); }
public Ext2DirectoryRecord(byte[] data, int offset) { iNodeNr = (int) Ext2Utils.get32(data, offset); recLen = Ext2Utils.get16(data, offset + 4); nameLen = Ext2Utils.get8(data, offset + 6); type = Ext2Utils.get8(data, offset + 7); name = new StringBuffer(); if (iNodeNr != 0) { for (int i = 0; i < nameLen; i++) name.ap...
public Ext2DirectoryRecord(byte[] data, int offset, int fileOffset) { this.data = data; this.offset = offset; this.fileOffset = fileOffset;
public Ext2DirectoryRecord(byte[] data, int offset) { iNodeNr = (int) Ext2Utils.get32(data, offset); recLen = Ext2Utils.get16(data, offset + 4); nameLen = Ext2Utils.get8(data, offset + 6); type = Ext2Utils.get8(data, offset + 7); name = new StringBuffer(); if (iNodeNr != 0) { //XXX character conversion for (...
return recLen;
return Ext2Utils.get16(data, offset+4);
public int getRecLen() { return recLen; }
return iNodeNr;
return (int)Ext2Utils.get32(data, offset);
public int getINodeNr() { return iNodeNr; }
StringBuffer name = new StringBuffer(); if(getINodeNr()!=0) { for(int i=0; i<getNameLen(); i++) name.append( (char)Ext2Utils.get8(data, offset+8+i) ); log.debug("Ext2DirectoryRecord(): iNode="+getINodeNr()+", name="+name); }
public String getName() { return name.toString(); }