mil.dod.th.ose.core/src/mil/dod/th/ose/core/impl/validator/ValidatorImpl.java
private Source createSource(final Object object)
            throws ValidationFailedException
    {
        Object objectContainingSource = object;
        if (object instanceof Command || object instanceof Response)
        {
            final XmlType xmlType = object.getClass().getAnnotation(XmlType.class);
            final QName qName = new QName(xmlType.namespace(),
                    CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, xmlType.name()));
            @SuppressWarnings({"rawtypes", "unchecked"})
            final JAXBElement jaxbElementWrapper = new JAXBElement(qName, object.getClass(), null, object);
            //now that the data is wrapped to create root element the source can be properly created
            objectContainingSource = jaxbElementWrapper;
        }
        try
        {
            return m_XmlService.createJAXBSource(m_JAXBContextFactory.getContext(object.getClass()), 
                    objectContainingSource);
        }
        catch (final JAXBException exception)
        {
            throw new ValidationFailedException(
                String.format("Could not create JAXBSource for %s", object.getClass()), exception);
        }
    }
/**
     * Creates a new JAXBSource from the object and the JAXBContext.
     * 
     * @param object
     *            the specified object
     * @return a JAXBSource instance if successful, else null
     * @throws ValidationFailedException
     *             if JAXBSource creation fails
     */
Creates a new JAXBSource from the object and the JAXBContext.

@param object
the specified object
@return a JAXBSource instance if successful, else null
@throws ValidationFailedException
if JAXBSource creation fails
Creates a new JAXBSource from the object and the JAXBContext . @param object the specified object @return a JAXBSource instance if successful else null @throws ValidationFailedException if JAXBSource creation fails
private Source createSource(final Object object)
            throws ValidationFailedException
    {
        Object objectContainingSource = object;
        if (object instanceof Command || object instanceof Response)
        {
            final XmlType xmlType = object.getClass().getAnnotation(XmlType.class);
            final QName qName = new QName(xmlType.namespace(),
                    CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, xmlType.name()));
            @SuppressWarnings({"rawtypes", "unchecked"})
            final JAXBElement jaxbElementWrapper = new JAXBElement(qName, object.getClass(), null, object);
            objectContainingSource = jaxbElementWrapper;
        }
        try
        {
            return m_XmlService.createJAXBSource(m_JAXBContextFactory.getContext(object.getClass()), 
                    objectContainingSource);
        }
        catch (final JAXBException exception)
        {
            throw new ValidationFailedException(
                String.format("Could not create JAXBSource for %s", object.getClass()), exception);
        }
    }
private Source createSource ( final Object object ) throws ValidationFailedException { Object objectContainingSource = object ; if ( object instanceof Command || object instanceof Response ) { final XmlType xmlType = object . getClass ( ) . getAnnotation ( XmlType . class ) ; final QName qName = new QName ( xmlType . namespace ( ) , CaseFormat . UPPER_CAMEL . to ( CaseFormat . LOWER_CAMEL , xmlType . name ( ) ) ) ; @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) final JAXBElement jaxbElementWrapper = new JAXBElement ( qName , object . getClass ( ) , null , object ) ; objectContainingSource = jaxbElementWrapper ; } try { return m_XmlService . createJAXBSource ( m_JAXBContextFactory . getContext ( object . getClass ( ) ) , objectContainingSource ) ; } catch ( final JAXBException exception ) { throw new ValidationFailedException ( String . format ( "Could not create JAXBSource for %s" , object . getClass ( ) ) , exception ) ; } }
Creates a new JAXBSource from the object and the JAXBContext.
Creates a new JAXBSource from the object and the JAXBContext .
//now that the data is wrapped to create root element the source can be properly created