XmlDocumentFactory Class

com.bea.ide.lang.xml
XmlDocumentFactory Class

public class XmlDocumentFactory

    extends TextDocumentFactory

Hierarchy
Object
  DefaultDocumentHandler
    TextDocumentFactory
      XmlDocumentFactory
All Implemented Interfaces

IDocumentHandler

Field Summary

protected Set
_setRegistered
Set
protected static final Pattern
XML_PATTERN
Pattern
 

Constructor Summary

XmlDocumentFactory()

XmlDocumentFactory(String sDefaultExtension)

 

Method Summary

protected IDocument
createDocumentObject(URI uriFile)
This method must be implemented by derived classes to create the actual IDocument interface that this handler provides.
protected static String
getExtension(URI uriFile)
protected Reader
getTemplate(URI uriFile, String sTemplateId)
This method may be overridden to return default content for a new file created using this handler.
protected boolean
registerExtension(String sExt)
public int
resolveUnknownPriority(IDocumentHandler.IHandlerContext hc)
Declares that documents created by this factor have reasonable faith that they can correctly understand .txt files, but only if the file doesn't contain telltale binary characters (in the first 1K).
 
Methods from  com.bea.ide.document.DefaultDocumentHandler
createDocumentObject, createNewFile, getBaseName, getDefaultExtension, getExtension, getHandlerId, invalidNameCheck, openDocument, resolveUnknownPriority, suggestValidName
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.ide.document.IDocumentHandler
createNewFile, getBaseName, getDefaultExtension, getHandlerId, invalidNameCheck, openDocument, resolveUnknownPriority, suggestValidName
 

Field Detail

_setRegistered

protected Set _setRegistered


XML_PATTERN

protected static final Pattern XML_PATTERN

 

Constructor Detail

XmlDocumentFactory

public XmlDocumentFactory()

XmlDocumentFactory

public XmlDocumentFactory(String sDefaultExtension)
 

Method Detail

createDocumentObject(URI) Method

protected IDocument createDocumentObject(URI uriFile)
throws IOException
Description copied from DefaultDocumentHandler.createDocumentObject(URI)
This method must be implemented by derived classes to create the actual IDocument interface that this handler provides. It is expected that uriFile exists.

Overrides
TextDocumentFactory.createDocumentObject(URI)

Returns

An object implementing the IDocument interface that represents the contents of the given file

Exceptions

IOException

getExtension(URI) Method

protected static String getExtension(URI uriFile)

getTemplate(URI, String) Method

protected Reader getTemplate(URI uriFile, 
                             String sTemplateId)
Description copied from DefaultDocumentHandler.getTemplate(URI, String)
This method may be overridden to return default content for a new file created using this handler. The default implementation returns null, resulting in a blank file.

Overrides
DefaultDocumentHandler.getTemplate(URI, String)

Parameters

uriFile
Name of the new file being created

Returns

A java.io.Reader object that will be used to write the contents of the new file

registerExtension(String) Method

protected boolean registerExtension(String sExt)

resolveUnknownPriority(IDocumentHandler.IHandlerContext) Method

public int resolveUnknownPriority(IDocumentHandler.IHandlerContext hc)
Description copied from TextDocumentFactory.resolveUnknownPriority(IDocumentHandler.IHandlerContext)
Declares that documents created by this factor have reasonable faith that they can correctly understand .txt files, but only if the file doesn't contain telltale binary characters (in the first 1K).

Overrides
TextDocumentFactory.resolveUnknownPriority(IDocumentHandler.IHandlerContext)

Parameters

hc
Handler context containing relevant information about the file.