📄 minml2.java
字号:
public void setDTDHandler(final DTDHandler handler) { // not implemented } public DTDHandler getDTDHandler() { return null; } public void setEntityResolver(final EntityResolver resolver) { // not implemented } public EntityResolver getEntityResolver() { return null; } public String getDefaultNamespace() { return this.defaultNamespace; } public String getNamespace(final String tag) { return (String)this.namespaces.get(tag); } public void startDocument() throws SAXException { } public Writer startDocument(final Writer writer) throws SAXException { this.contentHandler.startDocument(); return writer; } public void endDocument() throws SAXException { } public void startPrefixMapping(final String prefix, final String uri) throws SAXException { } public void endPrefixMapping(final String prefix) throws SAXException { } public void startElement(final String namespaceURI, final String localName, final String qName, final Attributes atts) throws SAXException { } public Writer startElement(final String namespaceURI, final String localName, final String qName, final Attributes atts, final Writer writer) throws SAXException { this.contentHandler.startElement(namespaceURI, localName, qName, atts); return writer; } public void endElement(final String namespaceURI, final String localName, final String qName) throws SAXException { } public void characters(final char ch[], final int start, final int length) throws SAXException { } public void ignorableWhitespace(final char ch[], final int start, final int length) throws SAXException { // not implemented } public void processingInstruction(final String target, final String data) throws SAXException { // not implemented } public void skippedEntity(final String name) throws SAXException { // not implemented } public boolean getFeature(final String name) throws SAXNotRecognizedException, SAXNotSupportedException { if (name.equals("http://xml.org/sax/features/namespaces")) return true; if (name.equals("http://xml.org/sax/features/namespace-prefixes")) return false; if (name.equals("http://xml.org/sax/features/validation")) return false; throw new SAXNotRecognizedException(name); } public void setFeature(final String name, final boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { if (name.equals("http://xml.org/sax/features/namespaces") || name.equals("http://xml.org/sax/features/namespace-prefixes") || name.equals("http://xml.org/sax/features/validation")) throw new SAXNotSupportedException(name); throw new SAXNotRecognizedException(name); } public Object getProperty(final String name) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotRecognizedException(name); } public void setProperty(final String name, final Object value) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotRecognizedException(name); } public void warning(final SAXParseException e) throws SAXException { } public void error(final SAXParseException e) throws SAXException { } public void fatalError(final SAXParseException e) throws SAXException { throw e; } public String getPublicId() { return ""; } public String getSystemId() { return ""; } public int getLineNumber () { return this.lineNumber; } public int getColumnNumber () { return this.columnNumber; } private void fatalError(final String msg, final int lineNumber, final int columnNumber) throws SAXException { this.errorHandler.fatalError(new SAXParseException(msg, null, null, lineNumber, columnNumber)); } private class MinMLBuffer extends Writer { public MinMLBuffer(final Reader in) { this.in = in; } public void close() throws IOException { flush(); } public void flush() throws IOException { try { _flush(); if (writer != this) writer.flush(); } finally { flushed = true; } } public void write(final int c) throws IOException { written = true; chars[count++] = (char)c; } public void write(final char[] cbuf, final int off, final int len) throws IOException { written = true; System.arraycopy(cbuf, off, chars, count, len); count += len; } public void saveChar(final char c) { written = false; chars[count++] = c; } public void pushWriter(final Writer writer) { MinML2.this.stack.push(this.writer); this.writer = (writer == null) ? this : writer; flushed = written = false; } public Writer getWriter() { return writer; } public void popWriter() throws IOException { try { if (!flushed && writer != this) writer.flush(); } finally { writer = (Writer)MinML2.this.stack.pop(); flushed = written = false; } } public String getString() { final String result = new String(chars, 0, count); count = 0; return result; } public void reset() { count = 0; } public int read() throws IOException { if (nextIn == lastIn) { if (count != 0) { if (written) { _flush(); } else if (count >= (chars.length - MinML2.this.bufferIncrement)) { final char[] newChars = new char[chars.length + MinML2.this.bufferIncrement]; System.arraycopy(chars, 0, newChars, 0, count); chars = newChars; } } final int numRead = in.read(chars, count, chars.length - count); if (numRead == -1) return -1; nextIn = count; lastIn = count + numRead; } return chars[nextIn++]; } private void _flush() throws IOException { if (count != 0) { try { if (writer == this) { try { MinML2.this.contentHandler.characters(chars, 0, count); } catch (final SAXException e) { throw new IOException(e.toString()); } } else { writer.write(chars, 0, count); } } finally { count = 0; } } } private int nextIn = 0, lastIn = 0; private char[] chars = new char[MinML2.this.initialBufferSize]; private final Reader in; private int count = 0; private Writer writer = this; private boolean flushed = false; private boolean written = false; } private ContentHandler extContentHandler = this; private org.xml.sax.ContentHandler contentHandler = this; private ErrorHandler errorHandler = this; private final Stack stack = new Stack(); private int lineNumber = 1; private int columnNumber = 0; private final int initialBufferSize; private final int bufferIncrement; private final Hashtable namespaces = new Hashtable(); private String defaultNamespace = ""; private static final byte[] charClasses = { // EOF 13, // \t \n \r -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 12, -1, -1, 12, -1, -1, // -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // SP ! " # $ % & ' ( ) * + , - . / 12, 8, 7, 14, 14, 14, 3, 6, 14, 14, 14, 14, 14, 11, 14, 2, // 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 5, 1, 4, // 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, // [ \ ] 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 9, 14, 10 }; private static final String[] operands = { "\u0d15\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u0015\u0010\u1611", "\u1711\u1000\u0b00\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u0114\u0200\u1811\u0114", "\u1711\u1001\u0b01\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u0215\u1811\u0414", "\u1711\u1001\u0b01\u1711\u1911\u1911\u1911\u1911\u1911\u1911\u1911\u1911\u0315\u1811\u0414", "\u1911\u1911\u1911\u1911\u1911\u0606\u1911\u1911\u1911\u1911\u1911\u0414\u0515\u1811\u0414", "\u1911\u1911\u1911\u1911\u1911\u0606\u1911\u1911\u1911\u1911\u1911\u1911\u0515\u1811\u1911", "\u1a11\u1a11\u1a11\u1a11\u1a11\u1a11\u0715\u0815\u1a11\u1a11\u1a11\u1a11\u0615\u1811\u1a11", "\u0714\u0714\u0714\u070e\u0714\u0714\u0307\u0714\u0714\u0714\u0714\u0714\u0714\u1811\u0714", "\u0814\u0814\u0814\u080e\u0814\u0814\u0814\u0307\u0814\u0814\u0814\u0814\u0814\u1811\u0814", "\u1711\u1002\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u0914\u0915\u1811\u0914", "\u1b11\u1b11\u0904\u1b11\u1b11\u1b11\u1b11\u1b11\u1215\u1b11\u1b11\u1b11\u1b11\u1811\u0105", "\u1711\u1012\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1811\u1711", "\u1711\u1c11\u0912\u1711\u0e12\u1711\u1711\u1711\u1212\u1711\u1711\u1711\u1711\u1811\u0113", "\u1711\u1c11\u0912\u1711\u0e12\u1711\u1711\u1711\u1212\u1711\u1711\u1711\u1711\u1811\u0113", "\u0e15\u0e15\u0e15\u0e15\u0f15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u1811\u0e15", "\u0e15\u0015\u0e15\u0e15\u0f15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u1811\u0e15", "\u0c03\u110f\u110f\u110e\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u1014\u1811\u110f", "\u0a15\u110f\u110f\u110e\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u1811\u110f", "\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u130c\u1d11\u1408\u1d11\u1811\u1515", "\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u110d\u130f\u130f\u1811\u130f", "\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u0009\u1415\u1811\u1415", "\u150a\u000b\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1811\u1515", "expected Element", "unexpected character in tag", "unexpected end of file found", "attribute name not followed by '='", "invalid attribute value", "expecting end tag", "empty tag", "unexpected character after <!" };}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -