Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * This file is part of the DiffX library.
   *
   * For licensing information please see the file license.txt included in the release.
   * A copy of this licence can also be found at
   *   http://www.opensource.org/licenses/artistic-license-2.0.php
   */
  package com.topologi.diffx.event.impl;
  
 
The event corresponding to the startElement SAX event.

Author(s):
Christophe Lauret
Version:
28 March 2010
 
 public final class CloseElementEventNSImpl extends DiffXEventBase implements CloseElementEvent {

  
The corresponding open element event.
 
   private final OpenElementEvent open;

  
Creates a new close element event on the default namespace URI.

Parameters:
name The local name of the element
Throws:
java.lang.NullPointerException If the name is null.
 
   public CloseElementEventNSImpl(String namethrows NullPointerException {
     if (name == null)
       throw new NullPointerException("Element must have a name.");
     this. = new OpenElementEventNSImpl(name);
   }

  
Creates a new close element event.

Parameters:
uri The namespace URI of the element
name The local name of the element
Throws:
java.lang.NullPointerException if any of the argument is null.
 
   public CloseElementEventNSImpl(String uriString namethrows NullPointerException {
     if (uri == null)
       throw new NullPointerException("The URI cannot be null, use \"\".");
     if (name == null)
       throw new NullPointerException("Element must have a name.");
     this. = new OpenElementEventNSImpl(uriname);
   }

  
Creates a new close element event from the corresponding open element event.

Parameters:
event The corresponding open element event.
Throws:
java.lang.NullPointerException If the name is null.
 
     if (event == null)
       throw new NullPointerException("Element must have a name.");
     this. = event;
   }

  

Returns:
Returns the name.
 
   @Override
   public String getName() {
     return this..getName();
   }

  

Returns:
Returns the namespace URI.
 
   @Override
   public String getURI() {
     return this..getURI();
   }
 
   @Override
     return this.;
   }
 
   @Override
   public boolean match(OpenElementEvent event) {
     if (event == nullreturn false;
     if (event == this.return true;
     return event.getURI().equals(getURI())
         &&  event.getName().equals(getName());
   }
  public int hashCode() {
    return 89 + this..hashCode();
  }

  
Returns true if the event is a close element event.

Parameters:
e The event to compare with this event.
Returns:
true if this event is equal to the specified event; false otherwise.
  public boolean equals(DiffXEvent e) {
    if (e.getClass() != this.getClass()) return false;
    return ce.getURI().equals(getURI())
        &&  ce.getName().equals(getName());
  }
  public String toString() {
    return "closeElement: "+getName()+" ["+getURI()+"]";
  }
  public void toXML(XMLWriter xmlthrows IOException {
    xml.closeElement();
  }
    // TODO: handle namespaces.
    xml.append("</").append(getName()).append('>');
    return xml;
  }
New to GrepCode? Check out our FAQ X