Search in sources :

Example 1 with ComponentHelperInfo

use of alma.acs.tools.comphelpergen.generated.ComponentHelperInfo in project ACS by ACS-Community.

the class CompHelperGenerator method getFilePar.

/**
	 * Method getFilePar. Gets information about COBs from xml input string.
	 * @param contents
	 * @return ComponentHelperInfo
	 */
protected ComponentHelperInfo getFilePar(String contents) {
    ComponentHelperInfo compHelpInfo = null;
    if (m_verbose) {
        System.out.println(contents);
    }
    Reader xmlReader = null;
    try {
        xmlReader = new StringReader(contents);
        if (xmlReader != null) {
            compHelpInfo = ComponentHelperInfo.unmarshalComponentHelperInfo(xmlReader);
        }
    } catch (ValidationException e) {
        e.printStackTrace();
    } catch (MarshalException e) {
        e.printStackTrace();
    } finally {
        if (xmlReader != null)
            try {
                xmlReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
    }
    return compHelpInfo;
}
Also used : MarshalException(org.exolab.castor.xml.MarshalException) ValidationException(org.exolab.castor.xml.ValidationException) StringReader(java.io.StringReader) StringReader(java.io.StringReader) Reader(java.io.Reader) IOException(java.io.IOException) ComponentHelperInfo(alma.acs.tools.comphelpergen.generated.ComponentHelperInfo)

Aggregations

ComponentHelperInfo (alma.acs.tools.comphelpergen.generated.ComponentHelperInfo)1 IOException (java.io.IOException)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1 MarshalException (org.exolab.castor.xml.MarshalException)1 ValidationException (org.exolab.castor.xml.ValidationException)1