Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.sapia.domain.dublincore.parser;
  
  
  // Import of Sapia's domain classes
  // --------------------------------
  
  // Import of Sapia's utility classes
  // ---------------------------------
 
 // Imports of David Meggison's SAX classes
 // ---------------------------------------
Title: Description: Copyright: Copyright (c) 2002 Company:

Author(s):
Version:
1.0
 
   /////////////////////////////////////////////////////////////////////////////////////////
   /////////////////////////////////  INSTANCE ATTRIBUTES  /////////////////////////////////
   /////////////////////////////////////////////////////////////////////////////////////////
 
  
Indicates if this handler state is currently parsing.
 
   private boolean _isParsing;

  
Buffer that contains the characters of the element beign parsed.
 
   private StringBuffer _theElementContent;

  
The result object of this handler state.
 
   private Publisher _thePublisher;
 
   /////////////////////////////////////////////////////////////////////////////////////////
   ////////////////////////////////////  CONSTRUCTORS  /////////////////////////////////////
   /////////////////////////////////////////////////////////////////////////////////////////
 
  
Creates a new PublisherHandlerState instance.
 
   public PublisherHandlerState() {
                = false;
        = new StringBuffer();
   }
 
   /////////////////////////////////////////////////////////////////////////////////////////
   //////////////////////////////////  ACCESSOR METHODS  ///////////////////////////////////
   /////////////////////////////////////////////////////////////////////////////////////////
 
  
Returns the result Publisher object of this handler state.

Returns:
The result Publisher object of this handler state.
Throws:
java.lang.IllegalStateException If this handler state is currently parsing.
 
   public Publisher getResult() {
     if ( == true) {
       throw new IllegalStateException(
         "This PublisherHandlerState is currently parsing");
     }
 
     return ;
   }
 
   /////////////////////////////////////////////////////////////////////////////////////////
   ///////////////////////////////  INTERACE IMPLEMENTATION  ///////////////////////////////
   /////////////////////////////////////////////////////////////////////////////////////////
 
  
Receives the notification of the the start of an element.

Parameters:
aContext The handler context.
anUri The namespace URI associated with the element
aLocalName The element type local name.
aQualifiedName The element type qualified name.
someAttributes The specified or defaulted attributes.
Throws:
org.xml.sax.SAXException If an exception occurs.
 
   public void startElement(HandlerContextIF aContextString anUri,
     String aLocalNameString aQualifiedNameAttributes someAttributes)
     throws SAXException {
     // Validating the namespace URI of the call
     validateNamespace(anUriaLocalNameaQualifiedName);
 
     if (.equals(aLocalName)) {
        = true;
 
       String anXmlLanguageCode = ParserUtil.extractXmlLanguageCode(someAttributes);
        = new Publisher(""anXmlLanguageCode);
     }
   }

  
Receives the notification of the the end of an element.

Parameters:
aContext The handler context.
anUri The namespace URI associated with the element
aLocalName The element type local name.
aQualifiedName The element type qualified name.
Throws:
org.xml.sax.SAXException If an exception occurs.
  public void endElement(HandlerContextIF aContextString anUri,
    String aLocalNameString aQualifiedNamethrows SAXException {
    // Validating the namespace URI of the call
    validateNamespace(anUriaLocalNameaQualifiedName);
    if (.equals(aLocalName)) {
       = false;
    }
  }

  
Receives the notification of character data inside an element.

Parameters:
aContext The handler context.
someChars The characters.
anOffset The start position in the character array.
aLength The number of characters to use from the character array.
Throws:
org.xml.sax.SAXException If an exception occurs.
  public void characters(HandlerContextIF aContextchar[] someChars,
    int anOffsetint lengththrows SAXException {
    .append(someCharsanOffsetlength);
  }

  
Receives the notification of ignorable whitespace in element content.

Parameters:
aContext The handler context.
someChars The whitespace characters.
anOffset The start position in the character array.
aLength The number of characters to use from the character array.
Throws:
org.xml.sax.SAXException If an exception occurs.
  public void ignorableWhitespace(HandlerContextIF aContextchar[] someChars,
    int anOffsetint aLengththrows SAXException {
    // IGNORING WHITESPACES...
  }
New to GrepCode? Check out our FAQ X