test_class.declarator: log = LoggerFactory.getLogger(JaxbUtilTest.class)
test_class.modifier: private final static
test_class.original_string: private final static Logger log = LoggerFactory.getLogger(JaxbUtilTest.class);
test_class.type: Logger
test_class.var_name: log
test_class.file: commons/components/commons-mule/src/test/java/org/soitoolkit/commons/mule/jaxb/JaxbUtilTest.java
test_class.identifier: JaxbUtilTest
test_case.body: @Test
  	public void testMarshal() {
  		
  		String expectedXml = 
  		"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
  		"<logEvent xmlns=\"urn:org.soitoolkit.commons.logentry.schema:v1\">" + 
  		"<logEntry>" +
  		"<payload>MyPayload</payload>" +
  		"</logEntry>" +
  		"</logEvent>";
  		
  		LogEvent logEvent = new LogEvent();
  		LogEntryType logEntry = new LogEntryType();
  		logEvent.setLogEntry(logEntry);
  		logEntry.setPayload("MyPayload");
  		
  		JaxbUtil jaxbUtil = new JaxbUtil(LogEvent.class);
  		String actualXml = jaxbUtil.marshal(logEvent);
  		
  		log.info(actualXml);
  		assertEquals(expectedXml, actualXml);
  	}
test_case.class_method_signature: JaxbUtilTest.testMarshal()
test_case.full_signature: @Test public void testMarshal()
test_case.identifier: testMarshal
test_case.invocations: setLogEntry setPayload marshal info assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMarshal()
focal_class.declarator: jaxbContext = null
focal_class.modifier: private
focal_class.original_string: private JAXBContext jaxbContext = null;
focal_class.type: JAXBContext
focal_class.var_name: jaxbContext
focal_class.declarator: logger = LoggerFactory.getLogger(getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: unmarshallProps = null
focal_class.modifier: private
focal_class.original_string: private Map<String, Object> unmarshallProps = null;
focal_class.type: Map<String, Object>
focal_class.var_name: unmarshallProps
focal_class.declarator: marshallProps = null
focal_class.modifier: private
focal_class.original_string: private Map<String, Object> marshallProps = null;
focal_class.type: Map<String, Object>
focal_class.var_name: marshallProps
focal_class.file: commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/jaxb/JaxbUtil.java
focal_class.identifier: JaxbUtil
focal_class.class_method_signature: JaxbUtil.JaxbUtil(Class... classesToBeBound)
focal_class.full_signature: @SuppressWarnings("rawtypes") public  JaxbUtil(Class... classesToBeBound)
focal_class.identifier: JaxbUtil
focal_class.modifiers: @SuppressWarnings("rawtypes") public
focal_class.parameters: (Class... classesToBeBound)
focal_class.signature:  JaxbUtil(Class... classesToBeBound)
focal_class.class_method_signature: JaxbUtil.JaxbUtil(String contextPath)
focal_class.full_signature: public  JaxbUtil(String contextPath)
focal_class.identifier: JaxbUtil
focal_class.modifiers: public
focal_class.parameters: (String contextPath)
focal_class.signature:  JaxbUtil(String contextPath)
focal_class.class_method_signature: JaxbUtil.getContext()
focal_class.full_signature: public JAXBContext getContext()
focal_class.identifier: getContext
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: JAXBContext
focal_class.signature: JAXBContext getContext()
focal_class.class_method_signature: JaxbUtil.setContextPath(String contextPath)
focal_class.full_signature: public void setContextPath(String contextPath)
focal_class.identifier: setContextPath
focal_class.modifiers: public
focal_class.parameters: (String contextPath)
focal_class.return: void
focal_class.signature: void setContextPath(String contextPath)
focal_class.class_method_signature: JaxbUtil.addMarshallProperty(String name, Object value)
focal_class.full_signature: public void addMarshallProperty(String name, Object value)
focal_class.identifier: addMarshallProperty
focal_class.modifiers: public
focal_class.parameters: (String name, Object value)
focal_class.return: void
focal_class.signature: void addMarshallProperty(String name, Object value)
focal_class.class_method_signature: JaxbUtil.addUnmarshallProperty(String name, Object value)
focal_class.full_signature: public void addUnmarshallProperty(String name, Object value)
focal_class.identifier: addUnmarshallProperty
focal_class.modifiers: public
focal_class.parameters: (String name, Object value)
focal_class.return: void
focal_class.signature: void addUnmarshallProperty(String name, Object value)
focal_class.class_method_signature: JaxbUtil.marshal(Object jaxbObject)
focal_class.full_signature: public String marshal(Object jaxbObject)
focal_class.identifier: marshal
focal_class.modifiers: public
focal_class.parameters: (Object jaxbObject)
focal_class.return: String
focal_class.signature: String marshal(Object jaxbObject)
focal_class.class_method_signature: JaxbUtil.marshal(Object jaxbObject, String namespaceURI, String localPart)
focal_class.full_signature: @SuppressWarnings({ "unchecked", "rawtypes" }) public String marshal(Object jaxbObject, String namespaceURI, String localPart)
focal_class.identifier: marshal
focal_class.modifiers: @SuppressWarnings({ "unchecked", "rawtypes" }) public
focal_class.parameters: (Object jaxbObject, String namespaceURI, String localPart)
focal_class.return: String
focal_class.signature: String marshal(Object jaxbObject, String namespaceURI, String localPart)
focal_class.class_method_signature: JaxbUtil.unmarshal(Object payload)
focal_class.full_signature: @SuppressWarnings("rawtypes") public Object unmarshal(Object payload)
focal_class.identifier: unmarshal
focal_class.modifiers: @SuppressWarnings("rawtypes") public
focal_class.parameters: (Object payload)
focal_class.return: Object
focal_class.signature: Object unmarshal(Object payload)
focal_method.body: public String marshal(Object jaxbObject) {
  
  		// Precondition, check that the jaxbContext is set!
      	if (jaxbContext == null) {
      		logger.error("Trying to marshal with a null jaxbContext, returns null. Check your configuration, e.g. jaxb-transformers!");
      		return null;
      	}
  
      	try {
  
              StringWriter writer = new StringWriter();
          	Marshaller marshaller = jaxbContext.createMarshaller();
          	if (marshallProps != null) {
  	        	for (Entry<String, Object> entry : marshallProps.entrySet()) {
  	        		marshaller.setProperty(entry.getKey(), entry.getValue());
  				}
          	}
          	marshaller.marshal(jaxbObject, writer);
  
          	String xml = writer.toString();
          	
              if (logger.isDebugEnabled()) logger.debug("marshalled jaxb object of type {}, returns xml: {}",  jaxbObject.getClass().getSimpleName(), xml);
            
              return xml;
  	    } catch (JAXBException e) {
  	        throw new RuntimeException(e);
  		}
      }
focal_method.class_method_signature: JaxbUtil.marshal(Object jaxbObject)
focal_method.full_signature: public String marshal(Object jaxbObject)
focal_method.identifier: marshal
focal_method.invocations: error createMarshaller entrySet setProperty getKey getValue marshal toString isDebugEnabled debug getSimpleName getClass
focal_method.modifiers: public
focal_method.parameters: (Object jaxbObject)
focal_method.return: String
focal_method.signature: String marshal(Object jaxbObject)