public I_CmsXmlContentHandler getContentHandler(String className, String schemaLocation) throws CmsXmlException {

        // create a unique key for the content deinition / class name combo
        StringBuffer buffer = new StringBuffer(128);
        buffer.append(schemaLocation);
        buffer.append('#');
        buffer.append(className);
        String key = buffer.toString();

        // look up the content handler from the cache
        I_CmsXmlContentHandler contentHandler = m_contentHandlers.get(key);
        if (contentHandler != null) {
            return contentHandler;
        }

        // generate an instance for the content handler
        try {
            contentHandler = (I_CmsXmlContentHandler)Class.forName(className).newInstance();
        } catch (InstantiationException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, key));
        } catch (IllegalAccessException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, key));
        } catch (ClassCastException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, key));
        } catch (ClassNotFoundException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, key));
        }

        // cache and return the content handler instance
        m_contentHandlers.put(key, contentHandler);
        return contentHandler;
    }
public I_CmsXmlContentHandler getContentHandler ( String className , String schemaLocation ) throws CmsXmlException { StringBuffer buffer = new StringBuffer ( 128 ) ; buffer . append ( schemaLocation ) ; buffer . append ( '#' ) ; buffer . append ( className ) ; String key = buffer . toString ( ) ; I_CmsXmlContentHandler contentHandler = m_contentHandlers . get ( key ) ; if ( contentHandler != null ) { return contentHandler ; } try { contentHandler = ( I_CmsXmlContentHandler ) Class . forName ( className ) . newInstance ( ) ; } catch ( InstantiationException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , key ) ) ; } catch ( IllegalAccessException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , key ) ) ; } catch ( ClassCastException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , key ) ) ; } catch ( ClassNotFoundException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , key ) ) ; } m_contentHandlers . put ( key , contentHandler ) ; return contentHandler ; }
Returns the XML content handler instance class for the specified class name.<p>

Only one instance of an XML content handler class per content definition name will be generated,
and that instance will be cached and re-used for all operations.<p>

@param className the name of the XML content handler to return
@param schemaLocation the schema location of the XML content definition that handler belongs to

@return the XML content handler class

@throws CmsXmlException if something goes wrong