Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.ojb.broker.metadata
Class RepositoryTags  view RepositoryTags download RepositoryTags.java

java.lang.Object
  extended byorg.apache.ojb.broker.metadata.RepositoryTags
All Implemented Interfaces:
RepositoryElements

public class RepositoryTags
extends java.lang.Object
implements RepositoryElements

this class maintains a table mapping the xml-tags used in the repository.dtd to their corresponding ids used within OJB. This table is used in
1. the RepositoryXmlHandler to identify tags on parsing the repository.xml in a large switch statement. 2. in the RepositoryPersistor to get the proper tag for a given XmlCapable id during assembling the repository.xml for output.
Important note: This class is the only place where XML tags from the repository.dtd are maintained. All usages of these tags within OJB must use this table to ease changes of the DTD.


Field Summary
private static RepositoryTags instance
          the singleton instance of this class.
private  org.apache.ojb.broker.util.DoubleHashtable table
          the two-way hashtable holding all entries.
 
Fields inherited from interface org.apache.ojb.broker.metadata.RepositoryElements
_LAST, ACCEPT_LOCKS, ATTRIBUTE, ATTRIBUTE_NAME, ATTRIBUTE_VALUE, AUTO_DELETE, AUTO_INCREMENT, AUTO_RETRIEVE, AUTO_UPDATE, BATCH_MODE, 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, DATABASE_REPOSITORY, DATASOURCE_NAME, DBMS_NAME, DEFAULT_CONNECTION, DOCUMENTATION, DRIVER_NAME, EAGER_RELEASE, EXTENDS, 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, INDEXED, INDIRECTION_TABLE, INVERSE_FK, ISOLATION_LEVEL, ITEMS_CLASS, JCD_ALIAS, JDBC_CONNECTION_DESCRIPTOR, JDBC_LEVEL, JDBC_TYPE, LENGTH, LOCKING, MAPPING_REPOSITORY, NULLABLE, ORDERBY, PRECISION, PRIMARY_KEY, PROXY_REFERENCE, REFERENCE_DESCRIPTOR, REFERENCED_CLASS, REFRESH_REFERENCE, REPOSITORY_VERSION, ROW_READER, SCALE, SCHEMA_NAME, SEQUENCE_MANAGER, SEQUENCE_MANAGER_CLASS, SEQUENCE_NAME, SORT, TABLE_NAME, URL_DBALIAS, URL_PROTOCOL, URL_SUBPROTOCOL, USE_AUTOCOMMIT, USER_NAME, USER_PASSWD, VALIDATION_QUERY
 
Constructor Summary
private RepositoryTags()
          private Constructor, please use getInstance() to obtain the singleton instance of this class.
 
Method Summary
 java.lang.String getAttribute(int elementId, java.lang.String value)
          returns the opening but non-closing xml-tag associated with the repository element with id elementId.
 java.lang.String getClosingTagById(int elementId)
          returns the closing xml-tag associated with the repository element with id elementId.
 java.lang.String getCompleteTagById(int elementId, java.lang.String characters)
          returns the opening xml-tag associated with the repository element with id elementId.
 int getIdByTag(java.lang.String tag)
          returns the repository element id associated with the xml-tag literal tag.
static RepositoryTags getInstance()
          returns the singleton instance.
 java.lang.String getOpeningTagById(int elementId)
          returns the opening xml-tag associated with the repository element with id elementId.
 java.lang.String getOpeningTagById(int elementId, java.lang.String attributes)
          returns the opening xml-tag associated with the repository element with id elementId.
 java.lang.String getOpeningTagNonClosingById(int elementId)
          returns the opening but non-closing xml-tag associated with the repository element with id elementId.
 java.lang.String getTagById(int elementId)
          returns the xml-tag literal associated with the repository element with id elementId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

private org.apache.ojb.broker.util.DoubleHashtable table
the two-way hashtable holding all entries.


instance

private static RepositoryTags instance
the singleton instance of this class.

Constructor Detail

RepositoryTags

private RepositoryTags()
private Constructor, please use getInstance() to obtain the singleton instance of this class.

Method Detail

getInstance

public static RepositoryTags getInstance()
returns the singleton instance.


getTagById

public java.lang.String getTagById(int elementId)
returns the xml-tag literal associated with the repository element with id elementId.


getOpeningTagById

public java.lang.String getOpeningTagById(int elementId)
returns the opening xml-tag associated with the repository element with id elementId.


getOpeningTagNonClosingById

public java.lang.String getOpeningTagNonClosingById(int elementId)
returns the opening but non-closing xml-tag associated with the repository element with id elementId.


getOpeningTagById

public java.lang.String getOpeningTagById(int elementId,
                                          java.lang.String attributes)
returns the opening xml-tag associated with the repository element with id elementId.


getAttribute

public java.lang.String getAttribute(int elementId,
                                     java.lang.String value)
returns the opening but non-closing xml-tag associated with the repository element with id elementId.


getClosingTagById

public java.lang.String getClosingTagById(int elementId)
returns the closing xml-tag associated with the repository element with id elementId.


getIdByTag

public int getIdByTag(java.lang.String tag)
returns the repository element id associated with the xml-tag literal tag.


getCompleteTagById

public java.lang.String getCompleteTagById(int elementId,
                                           java.lang.String characters)
returns the opening xml-tag associated with the repository element with id elementId.