[Jsxe-cvs] SF.net SVN: jsxe: [1240] branches/jsxe2/src/net/sourceforge/jsxe/dom/ XMLDocument.java
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-09-06 19:29:47
|
Revision: 1240 http://svn.sourceforge.net/jsxe/?rev=1240&view=rev Author: ian_lewis Date: 2006-09-06 12:29:43 -0700 (Wed, 06 Sep 2006) Log Message: ----------- Removed commented out code Modified Paths: -------------- branches/jsxe2/src/net/sourceforge/jsxe/dom/XMLDocument.java Modified: branches/jsxe2/src/net/sourceforge/jsxe/dom/XMLDocument.java =================================================================== --- branches/jsxe2/src/net/sourceforge/jsxe/dom/XMLDocument.java 2006-09-06 19:26:53 UTC (rev 1239) +++ branches/jsxe2/src/net/sourceforge/jsxe/dom/XMLDocument.java 2006-09-06 19:29:43 UTC (rev 1240) @@ -1775,41 +1775,6 @@ //}}} }//}}} - //{{{ ContentManagerOutputStream class - /** - * output stream to write to the content manager when the serialized. Used - * when syncing the source with the current Document. - * Currently not used. - */ - /* - private static class ContentManagerOutputStream extends OutputStream { - - //{{{ ContentManagerOutputStream constructor - public ContentManagerOutputStream(ContentManager content) { - m_m_content = content; - }//}}} - - //{{{ write() - public void write(int b) throws IOException { - byte []barray = { (byte)b }; - m_m_content.insert(m_m_content.getLength(), new String(barray)); - }//}}} - - //{{{ write() - public void write(byte[] b) throws IOException { - m_m_content.insert(m_m_content.getLength(), new String(b)); - }//}}} - - //{{{ write() - public void write(byte[] b, int off, int len) { - m_m_content.insert(m_m_content.getLength(), new String(b, off, len)); - }//}}} - - //{{{ Private members - private ContentManager m_m_content; - //}}} - }*///}}} - //{{{ ContentManagerWriter class /** * Character Stream used to write to the content manager when @@ -1875,134 +1840,6 @@ //}}} }//}}} - //{{{ ContentManagerInputStream class - /** - * Input stream for parsing/reading current text content. Currently not - * used. - */ - /* - private static class ContentManagerInputStream extends InputStream { - - //{{{ ContentManagerInputStream constructor - public ContentManagerInputStream(ContentManager content) { - m_m_content = content; - }//}}} - - //{{{ available() - public int available() { - return m_m_content.getLength() - m_m_index; - }//}}} - - //{{{ read() - public int read() { - if (m_m_index < m_m_content.getLength()) { - char[] text = m_m_content.getText(m_m_index++, 1).toCharArray(); - return (int)text[0]; - } else { - return -1; - } - }//}}} - - //{{{ read() - public int read(byte[] b) throws IOException { - return read(b, 0, b.length); - }//}}} - - //{{{ read() - public int read(byte[]b, int off, int len) { - if (len == 0) { - return 0; - } - - int length = len; - int contentLength = m_m_content.getLength(); - - //TODO this code doesn't support multi-byte characters - //contentLength below is the current number of characters - //what should be used is the total number of bytes in the document - //furthermore m_m_index is an character index into the - //document where it needs to be a byte index - if (m_m_index < contentLength) { - if (m_m_index + length >= contentLength) { - length = contentLength - m_m_index; - } - } else { - length = -1; - } - - //use UTF-8, want to esure it's UTF-8 instead of whatever - //the system default is. We'll only use the specified encoding - //when we write to disk. - if (length != -1) { - try { - - byte[] text = m_m_content.getText(m_m_index, length).getBytes("UTF-8"); - System.arraycopy(text, 0, b, off, length); - m_m_index += length; - - } catch (UnsupportedEncodingException uee) { - //UTF-8 is guaranteed to be supported. - Log.log(Log.ERROR, this, uee); - } - } - - return length; - - }//}}} - - //{{{ skip() - public long skip(long n) { - m_m_index += (int)n; - return n; - }//}}} - - //{{{ Private members - private int m_m_index = 0; - private ContentManager m_m_content; - //}}} - - }*///}}} - - //{{{ XMLDocAdapterListener class - /** - * An AdapterNodeListener is added to each AdapterNode in the tree so that - * the XMLDocument is notified when the structure changes. - */ - /* - private class XMLDocAdapterListener implements AdapterNodeListener { - - // {{{ nodeAdded() - public void nodeAdded(AdapterNode source, AdapterNode added) { - fireStructureChanged(source); - }//}}} - - //{{{ nodeRemoved() - public void nodeRemoved(AdapterNode source, AdapterNode removed) { - fireStructureChanged(source); - }//}}} - - //{{{ localNameChanged() - public void localNameChanged(AdapterNode source) { - fireStructureChanged(source); - }//}}} - - //{{{ namespaceChanged() - public void namespaceChanged(AdapterNode source) { - fireStructureChanged(source); - }//}}} - - //{{{ nodeValueChanged() - public void nodeValueChanged(AdapterNode source) { - fireStructureChanged(source); - }//}}} - - //{{{ attributeChanged() - public void attributeChanged(AdapterNode source, String attr) { - fireStructureChanged(source); - }//}}} - - }//}}}*/ - //{{{ SerializeErrorHandler class /** * Handles when parsing causes changes to the structure of the document. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |