APISonar


org.apache.abdera.model.Content.Type.XML

> org > apache > abdera > model > Content > Type > XML
org APIs apache APIs abdera APIs model APIs Content APIs Type APIs XML APIs

Example 1
protected void createEntryContent(Entry e, Object o, Class<?> cls) throws Exception {
    
        Factory factory = Abdera.getNewFactory();
        JAXBContext jc = jaxbProvider.getJAXBContext(cls, cls);
        
        StringWriter writer = new StringWriter();
        jc.createMarshaller().marshal(o, writer);
        
        e.setContentElement(factory.newContent());
        e.getContentElement().setContentType(Content.Type.XML);
        e.getContentElement().setValue(writer.toString());
        
    }
Example 2
protected void setEntryContent(Factory factory, Entry e, String content) {
        Content ct = factory.newContent(Content.Type.XML);
        ct.setValue(content);
        e.setContentElement(ct);
    }