站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

DocumentInputSource (XML Tools API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.api.xml/1 1.14

org.netbeans.api.xml.parsers
Class DocumentInputSource

java.lang.Object
  extended by org.xml.sax.InputSource
      extended by org.netbeans.api.xml.parsers.DocumentInputSource

public final class DocumentInputSource
extends InputSource

Integrate NetBeans widely used Swing's Document with SAX API's. Let it look like InputSource.


Constructor Summary
DocumentInputSource(Document doc)
          Creates new instance of DocumentInputSource.
 
Method Summary
 Reader getCharacterStream()
           
 String getSystemId()
          Get InputSource system ID.
 void setCharacterStream(Reader reader)
          This InputSource is backended by Swing's Document.
 String toString()
          For debugging purposes only.
 
Methods inherited from class org.xml.sax.InputSource
getByteStream, getEncoding, getPublicId, setByteStream, setEncoding, setPublicId, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentInputSource

public DocumentInputSource(Document doc)
Creates new instance of DocumentInputSource. Client should set system ID if available otherwise default one is derived.

Parameters:
doc - Swing document used to be wrapped
See Also:
getSystemId()
Method Detail

getCharacterStream

public Reader getCharacterStream()
Overrides:
getCharacterStream in class InputSource

setCharacterStream

public final void setCharacterStream(Reader reader)
This InputSource is backended by Swing's Document. Consequently its character stream is read-only, it always reads content of associted Document.

Overrides:
setCharacterStream in class InputSource

getSystemId

public String getSystemId()
Get InputSource system ID. Use ordered logic:
  • use client's setSystemId(), or
  • try to derive it from Document

    e.g. look at Document.StreamDescriptionProperty for DataObject and use URL of its primary file.

Overrides:
getSystemId in class InputSource
Returns:
entity system Id or null

toString

public String toString()
For debugging purposes only.

Overrides:
toString in class Object

org.netbeans.api.xml/1 1.14

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.