fr.gouv.culture.sdx.utils
Class AbstractSdxObject

java.lang.Object
  extended by fr.gouv.culture.sdx.utils.AbstractSdxObject
All Implemented Interfaces:
Describable, Encodable, Identifiable, Localizable, SdxObject, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.excalibur.xml.sax.XMLizable
Direct Known Subclasses:
AbstractDatabase, AbstractDocument, AbstractIDGenerator, AbstractQuery, AbstractRepository, AbstractRepositoryConnection, AbstractResponse, AnalyzerManager, Application, DatabaseBacked, Field, FieldList, FrameworkImpl, HSQLDB, IndexParameters, JDBC, LoggingIndexation, LuceneData, LuceneDataStore, LuceneQueryExpander, Property, ResultDocument, ResultDocuments, SearchLocations, SortSpecification, SQLDatabaseConnection, TermInfo, UserInformation

public abstract class AbstractSdxObject
extends java.lang.Object
implements SdxObject


Nested Class Summary
 
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject
SdxObject.ConfigurationNode
 
Field Summary
protected  org.apache.avalon.framework.configuration.Configuration _configuration
           
protected  org.apache.avalon.framework.context.DefaultContext _context
           
protected  org.apache.excalibur.source.Source _description
           
protected  java.lang.String _encoding
          The default encoding to be used when working with strings
protected  java.lang.String _id
           
protected  java.util.Locale _locale
           
protected  org.apache.avalon.framework.logger.Logger _logger
          Avalon logger to write information.
protected  org.apache.avalon.framework.service.ServiceManager _manager
           
protected  java.util.HashMap _xmlizable_objects
           
protected  java.lang.String _xmlLang
           
protected  boolean isToSaxInitialized
           
 
Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable
DEFAULT_ENCODING
 
Constructor Summary
AbstractSdxObject()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
protected  void configureDescription(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Sets the super.getLog() for this object.
protected  org.xml.sax.Attributes getBaseAttributes()
          Returns an SAX Attributes object containing the xml:lang, id, locale, encoding
protected abstract  java.lang.String getClassNameSuffix()
          Sub classes should element this method to return their class name suffix for SAX output
protected  org.apache.avalon.framework.configuration.Configuration getConfiguration()
           
protected  org.apache.avalon.framework.context.DefaultContext getContext()
           
 org.apache.excalibur.source.Source getDescription()
           
 java.lang.String getEncoding()
           
 java.lang.String getId()
           
 java.util.Locale getLocale()
           
 org.apache.avalon.framework.logger.Logger getLog()
           
protected  org.apache.avalon.framework.service.ServiceManager getServiceManager()
           
 java.lang.String getXmlLang()
          Returns the xml:lang attibute value from the configuration
protected abstract  boolean initToSax()
          Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML
protected abstract  void initVolatileObjectsToSax()
          Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called
 void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
           
 void setDescription(org.apache.excalibur.source.Source description)
           
 void setEncoding(java.lang.String encoding)
           
 void setId(java.lang.String id)
           
 void setLocale(java.util.Locale locale)
           
protected  SdxObject setUpSdxObject(SdxObject sdxObj)
           
protected  SdxObject setUpSdxObject(SdxObject sdxObj, org.apache.avalon.framework.configuration.Configuration configuration)
           
 void setXmlLang(java.lang.String lang)
           
 void toSAX(org.xml.sax.ContentHandler contentHandler)
           
protected  void verifyConfigurationResources()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected transient org.apache.avalon.framework.logger.Logger _logger
Avalon logger to write information.


_context

protected transient org.apache.avalon.framework.context.DefaultContext _context

_manager

protected transient org.apache.avalon.framework.service.ServiceManager _manager

_configuration

protected transient org.apache.avalon.framework.configuration.Configuration _configuration

_id

protected java.lang.String _id

_encoding

protected java.lang.String _encoding
The default encoding to be used when working with strings


_locale

protected java.util.Locale _locale

_xmlLang

protected java.lang.String _xmlLang

_description

protected transient org.apache.excalibur.source.Source _description

_xmlizable_objects

protected transient java.util.HashMap _xmlizable_objects

isToSaxInitialized

protected boolean isToSaxInitialized
Constructor Detail

AbstractSdxObject

public AbstractSdxObject()
Method Detail

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the super.getLog() for this object.

Setting the super.getLog() ensures proper logging of potential errors. If not set, this class won't be able to log any information. But it will still work.

Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

configureDescription

protected void configureDescription(org.apache.avalon.framework.configuration.Configuration configuration)
                             throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

setId

public void setId(java.lang.String id)
           throws SDXException
Specified by:
setId in interface Identifiable
Throws:
SDXException

setDescription

public void setDescription(org.apache.excalibur.source.Source description)
Specified by:
setDescription in interface Describable

setEncoding

public void setEncoding(java.lang.String encoding)
Specified by:
setEncoding in interface Encodable

setLocale

public void setLocale(java.util.Locale locale)
Specified by:
setLocale in interface Localizable

setXmlLang

public void setXmlLang(java.lang.String lang)
Specified by:
setXmlLang in interface Localizable

getLog

public org.apache.avalon.framework.logger.Logger getLog()
Specified by:
getLog in interface SdxObject

getContext

protected org.apache.avalon.framework.context.DefaultContext getContext()

getServiceManager

protected org.apache.avalon.framework.service.ServiceManager getServiceManager()

getConfiguration

protected org.apache.avalon.framework.configuration.Configuration getConfiguration()

getLocale

public java.util.Locale getLocale()
Specified by:
getLocale in interface Localizable

getId

public java.lang.String getId()
Specified by:
getId in interface Identifiable

getEncoding

public java.lang.String getEncoding()
Specified by:
getEncoding in interface Encodable

getDescription

public org.apache.excalibur.source.Source getDescription()
Specified by:
getDescription in interface Describable

getXmlLang

public java.lang.String getXmlLang()
Returns the xml:lang attibute value from the configuration

Specified by:
getXmlLang in interface Localizable

getBaseAttributes

protected org.xml.sax.Attributes getBaseAttributes()
Returns an SAX Attributes object containing the xml:lang, id, locale, encoding

Returns:
A SAX Attributes object

getClassNameSuffix

protected abstract java.lang.String getClassNameSuffix()
Sub classes should element this method to return their class name suffix for SAX output


initToSax

protected abstract boolean initToSax()
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML


initVolatileObjectsToSax

protected abstract void initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called


toSAX

public void toSAX(org.xml.sax.ContentHandler contentHandler)
           throws org.xml.sax.SAXException
Specified by:
toSAX in interface org.apache.excalibur.xml.sax.XMLizable
Throws:
org.xml.sax.SAXException

setUpSdxObject

protected SdxObject setUpSdxObject(SdxObject sdxObj)
                            throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

setUpSdxObject

protected SdxObject setUpSdxObject(SdxObject sdxObj,
                                   org.apache.avalon.framework.configuration.Configuration configuration)
                            throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

verifyConfigurationResources

protected void verifyConfigurationResources()
                                     throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException


Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.