org.norther.tammi.root.ojb.util
Class OJBDescriptorHandler

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.ojb.util.OJBDescriptorHandler
All Implemented Interfaces:
RepositoryElements, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class OJBDescriptorHandler
extends ClassDescriptorHandler
implements RepositoryElements

An OJB descriptor handler.

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
 
Field Summary
static RepositoryTags OJB_TAGS
          All known XML tags are kept in this table.
 
Fields inherited from interface org.apache.ojb.broker.metadata.RepositoryElements
_NEXT, ACCEPT_LOCKS, ACCESS, ATTRIBUTE, ATTRIBUTE_NAME, ATTRIBUTE_VALUE, AUTO_DELETE, AUTO_INCREMENT, AUTO_RETRIEVE, AUTO_UPDATE, BATCH_MODE, CASCADE_LINK_STR, CASCADE_NONE_STR, CASCADE_OBJECT_STR, CLASS_DESCRIPTOR, CLASS_EXTENT, CLASS_NAME, CLASS_PROXY, CLASS_REF, COLLECTION_CLASS, COLLECTION_DESCRIPTOR, COLUMN_NAME, CON_LOG_ABANDONED, CON_MAX_ACTIVE, CON_MAX_IDLE, CON_MAX_WAIT, CON_MIN_EVICTABLE_IDLE_TIME_MILLIS, CON_NUM_TESTS_PER_EVICTION_RUN, CON_REMOVE_ABANDONED, CON_REMOVE_ABANDONED_TIMEOUT, CON_TEST_ON_BORROW, CON_TEST_ON_RETURN, CON_TEST_WHILE_IDLE, CON_TIME_BETWEEN_EVICTION_RUNS_MILLIS, CON_WHEN_EXHAUSTED_ACTION, CONNECTION_FACTORY, CONNECTION_POOL, CONSTANT_ARGUMENT, DATASOURCE_NAME, DBMS_NAME, DEFAULT_CONNECTION, DELETE_PROCEDURE, DOCUMENTATION, DRIVER_NAME, EAGER_RELEASE, EXTENDS, FACTORY_CLASS, FACTORY_METHOD, FIELD_CONVERSION, FIELD_DESCRIPTOR, FIELD_ID_REF, FIELD_NAME, FIELD_REF, FK_POINTING_TO_ITEMS_CLASS, FK_POINTING_TO_THIS_CLASS, FOREIGN_KEY, ID, IGNORE_AUTOCOMMIT_EXCEPTION, INCLUDE_ALL_FIELDS, INCLUDE_PK_FIELDS_ONLY, INDEX_COLUMN, INDEX_DESCRIPTOR, INDEXED, INDIRECTION_TABLE, INITIALIZATION_METHOD, INSERT_PROCEDURE, INVERSE_FK, ISOLATION_LEVEL, ITEMS_CLASS, JCD_ALIAS, JDBC_CONNECTION_DESCRIPTOR, JDBC_LEVEL, JDBC_TYPE, LENGTH, LOCKING, MAPPING_REPOSITORY, NAME, NULLABLE, OBJECT_CACHE, ORDERBY, OTM_DEPENDENT, PRECISION, PRIMARY_KEY, PROXY_PREFETCHING_LIMIT, PROXY_REFERENCE, QUERY_CUSTOMIZER, REFERENCE_DESCRIPTOR, REFERENCED_CLASS, REFRESH, REPOSITORY_VERSION, RETURN, RETURN_FIELD_REF, ROW_READER, RUNTIME_ARGUMENT, SCALE, SCHEMA_NAME, SEQUENCE_MANAGER, SEQUENCE_MANAGER_CLASS, SEQUENCE_NAME, SORT, TABLE_NAME, TAG_ACCESS, TAG_ACCESS_ANONYMOUS, TAG_ACCESS_READONLY, TAG_ACCESS_READWRITE, TAG_SUPER, UNIQUE, UPDATE_LOCK, UPDATE_PROCEDURE, URL_DBALIAS, URL_PROTOCOL, URL_SUBPROTOCOL, USE_AUTOCOMMIT, USER_NAME, USER_PASSWD, VALIDATION_QUERY, VALUE
 
Constructor Summary
OJBDescriptorHandler(LoaderMBean loader, VariableRegistry registry)
          Constructs a new handler.
 
Method Summary
 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
characters, 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
 

Field Detail

OJB_TAGS

public static final RepositoryTags OJB_TAGS
All known XML tags are kept in this table.

Constructor Detail

OJBDescriptorHandler

public OJBDescriptorHandler(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

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.

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.

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.


Copyright © 2004 The Norther Organization. All rights reserved.