Package org.eclipse.wst.sse.core.internal.cleanup

Examples of org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler


    if (node != null) {
      Node childNode = node.getFirstChild();
      HTMLCleanupHandlerFactory factory = HTMLCleanupHandlerFactory.getInstance();
      while (childNode != null) {
        // cleanup this child node
        IStructuredCleanupHandler cleanupHandler = factory.createHandler(childNode, getCleanupPreferences());
        childNode = cleanupHandler.cleanup(childNode);

        // get new parent node
        parentNode = childNode.getParentNode();

        // get next child node
View Full Code Here


    super();
  }

  IStructuredCleanupHandler createHandler(Node node, IStructuredCleanupPreferences cleanupPreferences) {
    short nodeType = node.getNodeType();
    IStructuredCleanupHandler handler = null;
    switch (nodeType) {
      case Node.ELEMENT_NODE : {
        if (isXMLTag(node))
          handler = new ElementNodeCleanupHandler();
        else
          handler = new JSPElementNodeCleanupHandler();
        break;
      }
      case Node.TEXT_NODE : {
        if (isParentStyleTag(node))
          handler = new CSSTextNodeCleanupHandler();
        else
          handler = new NodeCleanupHandler();
        break;
      }
      default : {
        handler = new NodeCleanupHandler();
      }
    }

    handler.setCleanupPreferences(cleanupPreferences);

    return handler;
  }
View Full Code Here

    if (node != null) {
      Node childNode = node.getFirstChild();
      HTMLCleanupHandlerFactory factory = HTMLCleanupHandlerFactory.getInstance();
      while (childNode != null) {
        // cleanup this child node
        IStructuredCleanupHandler cleanupHandler = factory.createHandler(childNode, getCleanupPreferences());
        childNode = cleanupHandler.cleanup(childNode);

        // get new parent node
        parentNode = childNode.getParentNode();

        // get next child node
View Full Code Here

    return false;
  }

  protected IStructuredCleanupHandler getCleanupHandler(Node node) {
    short nodeType = node.getNodeType();
    IStructuredCleanupHandler cleanupHandler = null;
    switch (nodeType) {
      case Node.ELEMENT_NODE : {
        cleanupHandler = new ElementNodeCleanupHandler();
        break;
      }
      case Node.TEXT_NODE : {
        cleanupHandler = new NodeCleanupHandler();
        break;
      }
      default : {
        cleanupHandler = new NodeCleanupHandler();
      }
    }

    // init CleanupPreferences
    cleanupHandler.setCleanupPreferences(getCleanupPreferences());

    return cleanupHandler;
  }
View Full Code Here

    if (node != null) {
      Node childNode = node.getFirstChild();
      while (childNode != null) {
        // get cleanup handler
        IStructuredCleanupHandler cleanupHandler = getCleanupHandler(childNode);

        // cleanup each child
        childNode = cleanupHandler.cleanup(childNode);

        // get new parent node
        parentNode = childNode.getParentNode();

        // get next child node
View Full Code Here

    return newNode;
  }

  protected IStructuredCleanupHandler getCleanupHandler(Node node) {
    short nodeType = node.getNodeType();
    IStructuredCleanupHandler cleanupHandler = null;
    switch (nodeType) {
      case org.w3c.dom.Node.ELEMENT_NODE : {
        cleanupHandler = new ElementNodeCleanupHandler();
        break;
      }
      case org.w3c.dom.Node.TEXT_NODE : {
        cleanupHandler = new NodeCleanupHandler();
        break;
      }
      default : {
        cleanupHandler = new NodeCleanupHandler();
      }
    }

    // init CleanupPreferences
    cleanupHandler.setCleanupPreferences(getCleanupPreferences());

    return cleanupHandler;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.