org.norther.tammi.root.hibernate.util
Class HibernateMappingHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.norther.tammi.root.db.util.ClassDescriptorHandler
          extended by org.norther.tammi.root.hibernate.util.HibernateMappingHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class HibernateMappingHandler
extends ClassDescriptorHandler

A class for handling class mappings of missing classes.

Author:
Ilkka Priha.

Nested Class Summary
 
Nested classes/interfaces inherited from class org.norther.tammi.root.db.util.ClassDescriptorHandler
ClassDescriptorHandler.ClassTag, ClassDescriptorHandler.ElementTag, ClassDescriptorHandler.FieldTag
 
Constructor Summary
HibernateMappingHandler(LoaderMBean loader, VariableRegistry registry)
          Constructs a new handler.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(String uri, String name, String qName)
           
protected  Class getBaseClass(String qName, Attributes attrs)
          Gets the base class.
protected  String getClassName(String qName, Attributes attrs)
          Gets the class name.
protected  String getFieldName(String qName, Attributes attrs)
          Gets the field name.
protected  String getMetaName(String qName, Attributes attrs)
          Gets the meta name.
protected  String getMetaValue(String qName, Attributes attrs)
          Gets the meta value.
protected  boolean isClassElement(String qName)
          Checks whether a qualified element defines a class.
protected  boolean isFieldElement(String qName)
          Checks whether a qualified element defines a field.
protected  boolean isMetaElement(String qName)
          Checks whether a qualified element defines meta data.
 void startElement(String uri, String name, String qName, Attributes attrs)
          Handles a new class descriptor and registers a missing class as a dynamic Variable to VariableRegistry.
 
Methods inherited from class org.norther.tammi.root.db.util.ClassDescriptorHandler
endDocument, getCurrentTag, getLoaderMBean, getVariableClassNames, getVariableRegistry, startDocument
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateMappingHandler

public HibernateMappingHandler(LoaderMBean loader,
                               VariableRegistry registry)
Constructs a new handler.

Parameters:
loader - the MBean loader.
registry - the variable registry.
Method Detail

startElement

public void startElement(String uri,
                         String name,
                         String qName,
                         Attributes attrs)
Description copied from class: ClassDescriptorHandler
Handles a new class descriptor and registers a missing class as a dynamic Variable to VariableRegistry.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class ClassDescriptorHandler
Parameters:
uri - URI to the XML file.
name - the name of the element.
qName - the qualified name of the element.
attrs - attributes of the element.

endElement

public void endElement(String uri,
                       String name,
                       String qName)
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class ClassDescriptorHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler

isClassElement

protected boolean isClassElement(String qName)
Description copied from class: ClassDescriptorHandler
Checks whether a qualified element defines a class.

Specified by:
isClassElement in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
Returns:
true or false.

isFieldElement

protected boolean isFieldElement(String qName)
Description copied from class: ClassDescriptorHandler
Checks whether a qualified element defines a field.

Specified by:
isFieldElement in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
Returns:
true or false.

isMetaElement

protected boolean isMetaElement(String qName)
Description copied from class: ClassDescriptorHandler
Checks whether a qualified element defines meta data.

Specified by:
isMetaElement in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
Returns:
true or false.

getClassName

protected String getClassName(String qName,
                              Attributes attrs)
Description copied from class: ClassDescriptorHandler
Gets the class name.

Specified by:
getClassName in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
attrs - the attributes.
Returns:
the class name.

getFieldName

protected String getFieldName(String qName,
                              Attributes attrs)
Description copied from class: ClassDescriptorHandler
Gets the field name.

Specified by:
getFieldName in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
attrs - the attributes.
Returns:
the field name.

getMetaName

protected String getMetaName(String qName,
                             Attributes attrs)
Description copied from class: ClassDescriptorHandler
Gets the meta name.

Specified by:
getMetaName in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
attrs - the attributes.
Returns:
the meta name.

getMetaValue

protected String getMetaValue(String qName,
                              Attributes attrs)
Description copied from class: ClassDescriptorHandler
Gets the meta value.

Specified by:
getMetaValue in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
attrs - the attributes.
Returns:
the meta value.

getBaseClass

protected Class getBaseClass(String qName,
                             Attributes attrs)
Description copied from class: ClassDescriptorHandler
Gets the base class.

Specified by:
getBaseClass in class ClassDescriptorHandler
Parameters:
qName - the qualified name.
attrs - the attributes.
Returns:
the base class.


Copyright © 2004 The Norther Organization. All rights reserved.