private void writeColumn ( String columnName , Object value ) throws XMLStreamException { xmlStreamWriter . writeStartElement ( "column" ) ; xmlStreamWriter . writeAttribute ( "name" , columnName ) ; String stringValue = null ; if ( value instanceof CompositeObject ) { CompositeObject descriptor = ( CompositeObject ) value ; LanguageElement elementValue = LanguageHelper . getLanguageElement ( descriptor ) ; if ( elementValue != null ) { xmlStreamWriter . writeStartElement ( "element" ) ; xmlStreamWriter . writeAttribute ( "language" , elementValue . getLanguage ( ) ) ; xmlStreamWriter . writeCharacters ( elementValue . name ( ) ) ; xmlStreamWriter . writeEndElement ( ) ; // element SourceProvider sourceProvider = elementValue . getSourceProvider ( ) ; stringValue = sourceProvider . getName ( descriptor ) ; String sourceFile = sourceProvider . getSourceFile ( descriptor ) ; Integer lineNumber = sourceProvider . getLineNumber ( descriptor ) ; if ( sourceFile != null ) { xmlStreamWriter . writeStartElement ( "source" ) ; xmlStreamWriter . writeAttribute ( "name" , sourceFile ) ; if ( lineNumber != null ) { xmlStreamWriter . writeAttribute ( "line" , lineNumber . toString ( ) ) ; } xmlStreamWriter . writeEndElement ( ) ; // sourceFile } } } else if ( value != null ) { stringValue = ReportHelper . getLabel ( value ) ; } xmlStreamWriter . writeStartElement ( "value" ) ; xmlStreamWriter . writeCharacters ( stringValue ) ; xmlStreamWriter . writeEndElement ( ) ; // value xmlStreamWriter . writeEndElement ( ) ; // column }
Determines the language and language element of a descriptor from a result column .