@SuppressWarnings("unchecked")
    private void initialize(Document document, String editorUri) {

        m_parameters.clear();

        // get the root element of the configuration
        Element rootElement = document.getRootElement();

        // set the label of the editor
        setEditorLabel(rootElement.elementText(N_LABEL));

        // set the widget editor class if available
        String widgetClass = rootElement.elementText(N_WIDGETEDITOR);
        if (CmsStringUtil.isNotEmpty(widgetClass)) {
            setWidgetEditor(widgetClass);
        }

        // set the URI of the editor
        setEditorUri(editorUri);

        // create the map of valid resource types
        Iterator<Element> i = rootElement.element(N_RESOURCETYPES).elementIterator(N_TYPE);
        Map<String, String[]> resTypes = new HashMap<String, String[]>();
        while (i.hasNext()) {
            Element currentType = i.next();
            float ranking;
            String name = currentType.elementText(N_NAME);
            if (CmsStringUtil.isEmpty(name)) {
                logConfigurationError(Messages.get().getBundle().key(Messages.ERR_INVALID_RESTYPE_NAME_0), null);
                continue;
            }
            try {
                ranking = Float.parseFloat(currentType.elementText(N_RANKING));
            } catch (Throwable t) {
                logConfigurationError(Messages.get().getBundle().key(Messages.ERR_INVALID_RESTYPE_RANKING_1, name), t);
                continue;
            }
            String mapTo = currentType.elementText(N_MAPTO);
            if (CmsStringUtil.isEmpty(mapTo)) {
                mapTo = null;
            }
            resTypes.put(name, new String[] {"" + ranking, mapTo});
        }
        // add the additional resource types
        i = rootElement.element(N_RESOURCETYPES).elementIterator(N_CLASS);
        while (i.hasNext()) {
            Element currentClass = i.next();
            String name = currentClass.elementText(N_NAME);
            List<String> assignedTypes = new ArrayList<String>();
            try {
                // get the editor type matcher class
                I_CmsEditorTypeMatcher matcher = (I_CmsEditorTypeMatcher)Class.forName(name).newInstance();
                assignedTypes = matcher.getAdditionalResourceTypes();
            } catch (Throwable t) {
                logConfigurationError(Messages.get().getBundle().key(Messages.ERR_INVALID_RESTYPE_CLASS_1, name), t);
                continue;
            }
            float ranking;
            try {
                ranking = Float.parseFloat(currentClass.elementText(N_RANKING));
            } catch (Throwable t) {
                logConfigurationError(Messages.get().getBundle().key(Messages.ERR_INVALID_RESTYPE_RANKING_1, name), t);
                continue;
            }
            String mapTo = currentClass.elementText(N_MAPTO);
            if ("".equals(mapTo)) {
                mapTo = null;
            }
            // now loop through all types found and add them
            Iterator<String> j = assignedTypes.iterator();
            while (j.hasNext()) {
                String typeName = j.next();
                resTypes.put(typeName, new String[] {"" + ranking, mapTo});
            }
        }

        setResourceTypes(resTypes);

        // create the list of user agents & compiled patterns for editor
        i = document.getRootElement().element(N_USERAGENTS).elementIterator(N_AGENT);
        List<Pattern> pattern = new ArrayList<Pattern>();
        List<String> userAgents = new ArrayList<String>();
        while (i.hasNext()) {
            Element currentAgent = i.next();
            String agentName = currentAgent.getText();
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(agentName)) {
                userAgents.add(agentName);
                try {
                    pattern.add(Pattern.compile(agentName));
                } catch (PatternSyntaxException e) {
                    logConfigurationError(
                        Messages.get().getBundle().key(Messages.ERR_COMPILE_EDITOR_REGEX_1, agentName),
                        e);
                }
            } else {
                logConfigurationError(Messages.get().getBundle().key(Messages.ERR_INVALID_USERAGENT_DEF_0), null);
            }
        }
        setBrowserPattern(pattern);
        setUserAgentsRegEx(userAgents);

        Element paramsElement = (Element)(document.getRootElement().selectSingleNode(N_PARAMS));
        if (paramsElement != null) {
            List<?> params = paramsElement.selectNodes(N_PARAM);
            for (Object paramObj : params) {
                Element paramElement = (Element)paramObj;
                String name = paramElement.attributeValue(A_NAME);
                String value = paramElement.getText();
                m_parameters.put(name, value);
            }
        }
    }
@ SuppressWarnings ( "unchecked" ) private void initialize ( Document document , String editorUri ) { m_parameters . clear ( ) ; Element rootElement = document . getRootElement ( ) ; setEditorLabel ( rootElement . elementText ( N_LABEL ) ) ; String widgetClass = rootElement . elementText ( N_WIDGETEDITOR ) ; if ( CmsStringUtil . isNotEmpty ( widgetClass ) ) { setWidgetEditor ( widgetClass ) ; } setEditorUri ( editorUri ) ; Iterator < Element > i = rootElement . element ( N_RESOURCETYPES ) . elementIterator ( N_TYPE ) ; Map < String , String [ ] > resTypes = new HashMap < String , String [ ] > ( ) ; while ( i . hasNext ( ) ) { Element currentType = i . next ( ) ; float ranking ; String name = currentType . elementText ( N_NAME ) ; if ( CmsStringUtil . isEmpty ( name ) ) { logConfigurationError ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_INVALID_RESTYPE_NAME_0 ) , null ) ; continue ; } try { ranking = Float . parseFloat ( currentType . elementText ( N_RANKING ) ) ; } catch ( Throwable t ) { logConfigurationError ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_INVALID_RESTYPE_RANKING_1 , name ) , t ) ; continue ; } String mapTo = currentType . elementText ( N_MAPTO ) ; if ( CmsStringUtil . isEmpty ( mapTo ) ) { mapTo = null ; } resTypes . put ( name , new String [ ] { "" + ranking , mapTo } ) ; } i = rootElement . element ( N_RESOURCETYPES ) . elementIterator ( N_CLASS ) ; while ( i . hasNext ( ) ) { Element currentClass = i . next ( ) ; String name = currentClass . elementText ( N_NAME ) ; List < String > assignedTypes = new ArrayList < String > ( ) ; try { I_CmsEditorTypeMatcher matcher = ( I_CmsEditorTypeMatcher ) Class . forName ( name ) . newInstance ( ) ; assignedTypes = matcher . getAdditionalResourceTypes ( ) ; } catch ( Throwable t ) { logConfigurationError ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_INVALID_RESTYPE_CLASS_1 , name ) , t ) ; continue ; } float ranking ; try { ranking = Float . parseFloat ( currentClass . elementText ( N_RANKING ) ) ; } catch ( Throwable t ) { logConfigurationError ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_INVALID_RESTYPE_RANKING_1 , name ) , t ) ; continue ; } String mapTo = currentClass . elementText ( N_MAPTO ) ; if ( "" . equals ( mapTo ) ) { mapTo = null ; } Iterator < String > j = assignedTypes . iterator ( ) ; while ( j . hasNext ( ) ) { String typeName = j . next ( ) ; resTypes . put ( typeName , new String [ ] { "" + ranking , mapTo } ) ; } } setResourceTypes ( resTypes ) ; i = document . getRootElement ( ) . element ( N_USERAGENTS ) . elementIterator ( N_AGENT ) ; List < Pattern > pattern = new ArrayList < Pattern > ( ) ; List < String > userAgents = new ArrayList < String > ( ) ; while ( i . hasNext ( ) ) { Element currentAgent = i . next ( ) ; String agentName = currentAgent . getText ( ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( agentName ) ) { userAgents . add ( agentName ) ; try { pattern . add ( Pattern . compile ( agentName ) ) ; } catch ( PatternSyntaxException e ) { logConfigurationError ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_COMPILE_EDITOR_REGEX_1 , agentName ) , e ) ; } } else { logConfigurationError ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_INVALID_USERAGENT_DEF_0 ) , null ) ; } } setBrowserPattern ( pattern ) ; setUserAgentsRegEx ( userAgents ) ; Element paramsElement = ( Element ) ( document . getRootElement ( ) . selectSingleNode ( N_PARAMS ) ) ; if ( paramsElement != null ) { List < ? > params = paramsElement . selectNodes ( N_PARAM ) ; for ( Object paramObj : params ) { Element paramElement = ( Element ) paramObj ; String name = paramElement . attributeValue ( A_NAME ) ; String value = paramElement . getText ( ) ; m_parameters . put ( name , value ) ; } } }
Initializes all member variables.<p>

@param document the XML configuration document
@param editorUri the editor workplace URI