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

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

org.netbeans.api.xml/1 1.14

org.netbeans.spi.xml.cookies
Class ValidateXMLSupport

java.lang.Object
  extended by org.netbeans.spi.xml.cookies.ValidateXMLSupport
All Implemented Interfaces:
ValidateXMLCookie, Node.Cookie

public class ValidateXMLSupport
extends Object
implements ValidateXMLCookie

ValidateXMLCookie implementation support simplifing cookie providers based on InputSources representing XML documents and entities.

Primary use case in a DataObject subclass (which primary file is XML):

   CookieSet cookies = getCookieSet();
   InputSource in = DataObjectAdapters.inputSource(this);
   ValidateXMLSupport cookieImpl = new ValidateXMLSupport(in);
   cookies.add(cookieImpl);
 

Secondary use case: Subclasses can customize the class by customization protected methods. The customized subclass can be used according to primary use case.


Constructor Summary
ValidateXMLSupport(InputSource inputSource)
          Create new ValidateXMLSupport for given data object.
 
Method Summary
protected  EntityResolver createEntityResolver()
          Parametrizes default parser creatin process.
protected  InputSource createInputSource()
          Create InputSource to be checked.
protected  XMLReader createParser(boolean validate)
          Create and preconfigure new parser.
 boolean validateXML(CookieObserver l)
          Validate XML document entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidateXMLSupport

public ValidateXMLSupport(InputSource inputSource)
Create new ValidateXMLSupport for given data object.

Parameters:
inputSource - Supported InputSource.
Method Detail

validateXML

public boolean validateXML(CookieObserver l)
Description copied from interface: ValidateXMLCookie
Validate XML document entity.

Specified by:
validateXML in interface ValidateXMLCookie
Parameters:
l - Optional listener (null allowed) giving judgement details via XMLProcessorDetails.
Returns:
true if validity check passes.

createEntityResolver

protected EntityResolver createEntityResolver()
Parametrizes default parser creatin process. Default implementation takes user's catalog entity resolver.

Returns:
EntityResolver entity resolver or null

createInputSource

protected InputSource createInputSource()
                                 throws IOException
Create InputSource to be checked.

Returns:
InputSource never null
Throws:
IOException - if I/O error occurs.

createParser

protected XMLReader createParser(boolean validate)
Create and preconfigure new parser. Default implementation uses JAXP.

Parameters:
validate - true if validation module is required
Returns:
SAX reader that is used for command performing or null
See Also:
createEntityResolver()

org.netbeans.api.xml/1 1.14

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