Java 类org.xml.sax.DocumentHandler 实例源码

项目:In-the-Box-Fork    文件:XMLReaderAdapterTest.java   
@TestTargetNew(
    level = TestLevel.COMPLETE,
    method = "setDocumentHandler",
    args = { DocumentHandler.class }
)
public void testSetDocumentHandler() {
    // There is no getter for the DocumentHandler, so we can only test
    // indirectly whether is has been set correctly.
    try {
        adapter.startDocument();
    } catch (SAXException e) {
        throw new RuntimeException("Unexpected exception", e);
    }

    assertEquals("startDocument", logger.getMethod());
    assertEquals(new Object[] { }, logger.getArgs());

    // null case
    adapter.setDocumentHandler(null);
}
项目:In-the-Box-Fork    文件:XercesHTML2DocumentBuilderFactory.java   
public HTMLHandler(
    Constructor htmlBuilderConstructor,
    Method getHTMLDocumentMethod) throws Exception {
  htmlBuilder =
      (DocumentHandler) htmlBuilderConstructor.newInstance(
      new Object[0]);
  this.getHTMLDocumentMethod = getHTMLDocumentMethod;
}
项目:In-the-Box-Fork    文件:XercesHTMLDocumentBuilderFactory.java   
public HTMLHandler(
    Constructor htmlBuilderConstructor,
    Method getHTMLDocumentMethod) throws Exception {
  htmlBuilder =
      (DocumentHandler) htmlBuilderConstructor.newInstance(
      new Object[0]);
  this.getHTMLDocumentMethod = getHTMLDocumentMethod;
}
项目:ant    文件:ProjectHelperImpl.java   
/**
 * Start a new DataTypeHandler if element is known to be a
 * data-type and a TaskHandler otherwise.
 *
 * <p>Factored out of TargetHandler.</p>
 *
 * @since Ant 1.6
 */
private static void handleElement(ProjectHelperImpl helperImpl, DocumentHandler parent,
        Target target, String elementName, AttributeList attrs) throws SAXParseException {
    if ("description".equals(elementName)) {
        // created for side effect
        new DescriptionHandler(helperImpl, parent); //NOSONAR
    } else if (helperImpl.project.getDataTypeDefinitions().get(elementName) != null) {
        new DataTypeHandler(helperImpl, parent, target).init(elementName, attrs);
    } else {
        new TaskHandler(helperImpl, parent, target, null, target).init(elementName, attrs);
    }
}
项目:OpenJSharp    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:OpenJSharp    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:openjdk-jdk10    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:openjdk9    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:openjdk9    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:lookaside_java-1.8.0-openjdk    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:lookaside_java-1.8.0-openjdk    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:infobip-open-jdk-8    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:infobip-open-jdk-8    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:xerces-for-android    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:xerces-for-android    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:In-the-Box-Fork    文件:MockParser.java   
public void setDocumentHandler(DocumentHandler handler) {
    logger.add("setDocumentHandler", handler);
}
项目:In-the-Box-Fork    文件:DoNothingParser.java   
public void setDocumentHandler(DocumentHandler handler) {
}
项目:In-the-Box-Fork    文件:NoAccessParser.java   
public void setDocumentHandler(DocumentHandler handler) {
}
项目:In-the-Box-Fork    文件:NoInstanceParser.java   
public void setDocumentHandler(DocumentHandler handler) {
}
项目:In-the-Box-Fork    文件:NoSubclassParser.java   
public void setDocumentHandler(DocumentHandler handler) {
}
项目:ant    文件:ProjectHelperImpl.java   
/**
 * Constructor.
 *
 * @param parentHandler The handler which should be restored to the
 *                      parser at the end of the element.
 *                      Must not be <code>null</code>.
 *
 * @param parent        Parent of this element (task/data type/etc).
 *                      Must not be <code>null</code>.
 *
 * @param parentWrapper Wrapper for the parent element, if any.
 *                      Must not be <code>null</code>.
 *
 * @param target        Target this element is part of.
 *                      Must not be <code>null</code>.
 */
public NestedElementHandler(ProjectHelperImpl helperImpl,
                            DocumentHandler parentHandler,
                            Object parent,
                            RuntimeConfigurable parentWrapper,
                            Target target) {
    super(helperImpl, parentHandler);

    if (parent instanceof TypeAdapter) {
        this.parent = ((TypeAdapter) parent).getProxy();
    } else {
        this.parent = parent;
    }
    this.parentWrapper = parentWrapper;
    this.target = target;
}
项目:OLD-OpenJDK8    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:OLD-OpenJDK8    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:SplitCharater    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:android-boilerpipe    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:android-boilerpipe    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:openjdk-icedtea7    文件:BaseMarkupSerializer.java   
public DocumentHandler asDocumentHandler()
    throws IOException
{
    prepare();
    return this;
}
项目:openjdk-icedtea7    文件:ResolvingParser.java   
/** SAX Parser API. */
public void setDocumentHandler(DocumentHandler handler) {
  documentHandler = handler;
}
项目:ant    文件:ProjectHelperImpl.java   
/**
 * Creates a handler and sets the parser to use it
 * for the current element.
 *
 * @param helperImpl the ProjectHelperImpl instance associated
 *                   with this handler.
 *
 * @param parentHandler The handler which should be restored to the
 *                      parser at the end of the element.
 *                      Must not be <code>null</code>.
 */
public AbstractHandler(ProjectHelperImpl helperImpl, DocumentHandler parentHandler) {
    this.parentHandler = parentHandler;
    this.helperImpl = helperImpl;

    // Start handling SAX events
    helperImpl.parser.setDocumentHandler(this);
}
项目:ant    文件:ProjectHelperImpl.java   
/**
 * Constructor.
 *
 * @param parentHandler The handler which should be restored to the
 *                      parser at the end of the element.
 *                      Must not be <code>null</code>.
 *
 * @param container     Container for the element.
 *                      Must not be <code>null</code>.
 *
 * @param parentWrapper Wrapper for the parent element, if any.
 *                      May be <code>null</code>.
 *
 * @param target        Target this element is part of.
 *                      Must not be <code>null</code>.
 */
public TaskHandler(ProjectHelperImpl helperImpl, DocumentHandler parentHandler,
                   TaskContainer container,
                   RuntimeConfigurable parentWrapper, Target target) {
    super(helperImpl, parentHandler);
    this.container = container;
    this.parentWrapper = parentWrapper;
    this.target = target;
}
项目:OpenJSharp    文件:XMLReaderAdapter.java   
/**
 * Register the SAX1 document event handler.
 *
 * <p>Note that the SAX1 document handler has no Namespace
 * support.</p>
 *
 * @param handler The new SAX1 document event handler.
 * @see org.xml.sax.Parser#setDocumentHandler
 */
public void setDocumentHandler (DocumentHandler handler)
{
    documentHandler = handler;
}
项目:OpenJSharp    文件:AbstractSAXParser.java   
/**
 * Allow an application to register a document event handler.
 * <p>
 * If the application does not register a document handler, all
 * document events reported by the SAX parser will be silently
 * ignored (this is the default behaviour implemented by
 * HandlerBase).
 * <p>
 * Applications may register a new or different handler in the
 * middle of a parse, and the SAX parser must begin using the new
 * handler immediately.
 *
 * @param documentHandler The document handler.
 */
public void setDocumentHandler(DocumentHandler documentHandler) {
    fDocumentHandler = documentHandler;
}
项目:OpenJSharp    文件:Serializer.java   
/**
 * Return a {@link DocumentHandler} interface into this serializer.
 * If the serializer does not support the {@link DocumentHandler}
 * interface, it should return null.
 */
public DocumentHandler asDocumentHandler()
    throws IOException;
项目:openjdk-jdk10    文件:XMLReaderAdapter.java   
/**
 * Register the SAX1 document event handler.
 *
 * <p>Note that the SAX1 document handler has no Namespace
 * support.</p>
 *
 * @param handler The new SAX1 document event handler.
 * @see org.xml.sax.Parser#setDocumentHandler
 */
public void setDocumentHandler (DocumentHandler handler)
{
    documentHandler = handler;
}
项目:openjdk-jdk10    文件:AbstractSAXParser.java   
/**
 * Allow an application to register a document event handler.
 * <p>
 * If the application does not register a document handler, all
 * document events reported by the SAX parser will be silently
 * ignored (this is the default behaviour implemented by
 * HandlerBase).
 * <p>
 * Applications may register a new or different handler in the
 * middle of a parse, and the SAX parser must begin using the new
 * handler immediately.
 *
 * @param documentHandler The document handler.
 */
public void setDocumentHandler(DocumentHandler documentHandler) {
    fDocumentHandler = documentHandler;
}
项目:openjdk-jdk10    文件:Serializer.java   
/**
 * Return a {@link DocumentHandler} interface into this serializer.
 * If the serializer does not support the {@link DocumentHandler}
 * interface, it should return null.
 */
public DocumentHandler asDocumentHandler()
    throws IOException;
项目:openjdk9    文件:XMLReaderAdapter.java   
/**
 * Register the SAX1 document event handler.
 *
 * <p>Note that the SAX1 document handler has no Namespace
 * support.</p>
 *
 * @param handler The new SAX1 document event handler.
 * @see org.xml.sax.Parser#setDocumentHandler
 */
public void setDocumentHandler (DocumentHandler handler)
{
    documentHandler = handler;
}
项目:openjdk9    文件:AbstractSAXParser.java   
/**
 * Allow an application to register a document event handler.
 * <p>
 * If the application does not register a document handler, all
 * document events reported by the SAX parser will be silently
 * ignored (this is the default behaviour implemented by
 * HandlerBase).
 * <p>
 * Applications may register a new or different handler in the
 * middle of a parse, and the SAX parser must begin using the new
 * handler immediately.
 *
 * @param documentHandler The document handler.
 */
public void setDocumentHandler(DocumentHandler documentHandler) {
    fDocumentHandler = documentHandler;
}
项目:openjdk9    文件:Serializer.java   
/**
 * Return a {@link DocumentHandler} interface into this serializer.
 * If the serializer does not support the {@link DocumentHandler}
 * interface, it should return null.
 */
public DocumentHandler asDocumentHandler()
    throws IOException;
项目:Java8CN    文件:XMLReaderAdapter.java   
/**
 * Register the SAX1 document event handler.
 *
 * <p>Note that the SAX1 document handler has no Namespace
 * support.</p>
 *
 * @param handler The new SAX1 document event handler.
 * @see org.xml.sax.Parser#setDocumentHandler
 */
public void setDocumentHandler (DocumentHandler handler)
{
    documentHandler = handler;
}