mil.dod.th.ose.lexicon.doc/src/mil/dod/th/ose/lexicon/doc/parser/LexiconParser.java
private void handleOtherElement(final Element element, final String nodeName, final LexiconBase lexiconField)
    {
        if ((nodeName.equals("xs:extension") || nodeName.equals("xs:restriction")) //NOCHECKSTYLE repeated string
                && lexiconField instanceof LexiconComplexType)                     //makes code more readable.
        {
            final String base = getBaseAttribute(element);
            ((LexiconComplexType)lexiconField).setExtension(base);
        }
        else if (nodeName.equals("xs:restriction") && lexiconField instanceof LexiconSimpleType)
        {
            final String base = getBaseAttribute(element);
            ((LexiconSimpleType)lexiconField).setType(base);
        }
        else if (nodeName.equals("xs:minInclusive") && lexiconField instanceof LexiconSimpleType)
        {
            final String value = element.getAttribute(VALUE_ATTR);
            ((LexiconSimpleType)lexiconField).setMinInclusive(value);
        }
        else if (nodeName.equals("xs:maxInclusive") && lexiconField instanceof LexiconSimpleType)
        {
            final String value = element.getAttribute(VALUE_ATTR);
            ((LexiconSimpleType)lexiconField).setMaxInclusive(value);
        }
        else if (nodeName.equals("xs:documentation") && lexiconField != null)
        {
            lexiconField.setDescription(element.getTextContent().trim().replaceAll(
                    System.getProperty("line.separator"), "").replaceAll("\\s+", " ")); //NOCHECKSTYLE repeated empty string
        }                                                                               //makes code more readable.
        traverseNodes(element.getChildNodes(), element, lexiconField);
    }
/**
     * Method that determines how to handle an XSD element.
     * 
     * @param element
     *      Element to be handled.
     * @param nodeName
     *      Node name of the element.
     * @param lexiconField
     *      Lexicon field the element belongs to.
     */
Method that determines how to handle an XSD element.

@param element
Element to be handled.
@param nodeName
Node name of the element.
@param lexiconField
Lexicon field the element belongs to.
Method that determines how to handle an XSD element . @param element Element to be handled . @param nodeName Node name of the element . @param lexiconField Lexicon field the element belongs to .
private void handleOtherElement(final Element element, final String nodeName, final LexiconBase lexiconField)
    {
        if ((nodeName.equals("xs:extension") || nodeName.equals("xs:restriction")) 
                && lexiconField instanceof LexiconComplexType)                     
        {
            final String base = getBaseAttribute(element);
            ((LexiconComplexType)lexiconField).setExtension(base);
        }
        else if (nodeName.equals("xs:restriction") && lexiconField instanceof LexiconSimpleType)
        {
            final String base = getBaseAttribute(element);
            ((LexiconSimpleType)lexiconField).setType(base);
        }
        else if (nodeName.equals("xs:minInclusive") && lexiconField instanceof LexiconSimpleType)
        {
            final String value = element.getAttribute(VALUE_ATTR);
            ((LexiconSimpleType)lexiconField).setMinInclusive(value);
        }
        else if (nodeName.equals("xs:maxInclusive") && lexiconField instanceof LexiconSimpleType)
        {
            final String value = element.getAttribute(VALUE_ATTR);
            ((LexiconSimpleType)lexiconField).setMaxInclusive(value);
        }
        else if (nodeName.equals("xs:documentation") && lexiconField != null)
        {
            lexiconField.setDescription(element.getTextContent().trim().replaceAll(
                    System.getProperty("line.separator"), "").replaceAll("\\s+", " ")); 
        }                                                                               
        traverseNodes(element.getChildNodes(), element, lexiconField);
    }
private void handleOtherElement ( final Element element , final String nodeName , final LexiconBase lexiconField ) { if ( ( nodeName . equals ( "xs:extension" ) || nodeName . equals ( "xs:restriction" ) ) && lexiconField instanceof LexiconComplexType ) { final String base = getBaseAttribute ( element ) ; ( ( LexiconComplexType ) lexiconField ) . setExtension ( base ) ; } else if ( nodeName . equals ( "xs:restriction" ) && lexiconField instanceof LexiconSimpleType ) { final String base = getBaseAttribute ( element ) ; ( ( LexiconSimpleType ) lexiconField ) . setType ( base ) ; } else if ( nodeName . equals ( "xs:minInclusive" ) && lexiconField instanceof LexiconSimpleType ) { final String value = element . getAttribute ( VALUE_ATTR ) ; ( ( LexiconSimpleType ) lexiconField ) . setMinInclusive ( value ) ; } else if ( nodeName . equals ( "xs:maxInclusive" ) && lexiconField instanceof LexiconSimpleType ) { final String value = element . getAttribute ( VALUE_ATTR ) ; ( ( LexiconSimpleType ) lexiconField ) . setMaxInclusive ( value ) ; } else if ( nodeName . equals ( "xs:documentation" ) && lexiconField != null ) { lexiconField . setDescription ( element . getTextContent ( ) . trim ( ) . replaceAll ( System . getProperty ( "line.separator" ) , "" ) . replaceAll ( "\\s+" , " " ) ) ; } traverseNodes ( element . getChildNodes ( ) , element , lexiconField ) ; }
Method that determines how to handle an XSD element.
Method that determines how to handle an XSD element .
//NOCHECKSTYLE repeated string //makes code more readable. //NOCHECKSTYLE repeated empty string //makes code more readable.