Package org.apache.abdera.model.Content

Examples of org.apache.abdera.model.Content.Type


    JSONObject jscontent = new JSONObject();
    if (entry.getContentElement() != null) {

      Content content = entry.getContentElement();
      Type type = entry.getContentType();
      if (type.equals(Content.Type.HTML) || type.equals(Content.Type.XHTML) || type.equals(Content.Type.TEXT)) {
        jscontent.put("type", type.toString().toLowerCase());
      } else {
        jscontent.put("type", content.getMimeType().toString());
      }
      jscontent.put("value", JSONObject.quote(content.getValue()));
      jsentry.put("content", jscontent);
View Full Code Here


    JSONObject jscontent = new JSONObject();
    if (entry.getContentElement() != null) {

      Content content = entry.getContentElement();
      Type type = entry.getContentType();
      if (type.equals(Content.Type.HTML) || type.equals(Content.Type.XHTML) || type.equals(Content.Type.TEXT)) {
        jscontent.put("type", type.toString().toLowerCase());
      } else {
        jscontent.put("type", content.getMimeType().toString());
      }
      jscontent.put("value", JSONObject.quote(content.getValue()));
      jsentry.put("content", jscontent);
View Full Code Here

  public Object getContent(Node entry, RequestContext request) throws ResponseContextException {
   
    String typeStr = getStringOrNull(entry, CONTENT_TYPE);
    Factory factory = Abdera.getInstance().getFactory();
    String textContent = getStringOrNull(entry, CONTENT);
    Type type = Type.valueOf(typeStr);
    Content content = factory.newContent(type);
    switch (type) {
      case TEXT:
        content.setValue(textContent);
        return content;
View Full Code Here

    protected void process(Object source,
                           ObjectContext objectContext,
                           SerializationContext context,
                           Conventions conventions) {

        Type type = Type.TEXT;
        Object contentValue = null;
        ObjectContext valueContext = null;
        AccessibleObject accessor = objectContext.getAccessor(Value.class, conventions);
        if (accessor != null && !(source instanceof Element)) {
            contentValue = eval(accessor, source);
View Full Code Here

    public Object getContent(Node entry, RequestContext request) throws ResponseContextException {

        String typeStr = getStringOrNull(entry, CONTENT_TYPE);
        Factory factory = Abdera.getInstance().getFactory();
        String textContent = getStringOrNull(entry, CONTENT);
        Type type = Type.valueOf(typeStr);
        Content content = factory.newContent(type);
        switch (type) {
            case TEXT:
                content.setValue(textContent);
                return content;
View Full Code Here

    Object source,
    ObjectContext objectContext,
    SerializationContext context,
    Conventions conventions) {
     
      Type type = Type.TEXT;
      Object contentValue = null;
      ObjectContext valueContext = null;
      AccessibleObject accessor = objectContext.getAccessor(Value.class, conventions);
      if (accessor != null && !(source instanceof Element)) {
        contentValue = eval(accessor, source);
View Full Code Here

    JSONObject jscontent = new JSONObject();
    if (entry.getContentElement() != null) {

      Content content = entry.getContentElement();
      Type type = entry.getContentType();
      if (type.equals(Content.Type.HTML) || type.equals(Content.Type.XHTML) || type.equals(Content.Type.TEXT)) {
        jscontent.put("type", type.toString().toLowerCase());
      } else {
        jscontent.put("type", content.getMimeType().toString());
      }
      jscontent.put("value", content.getValue());;
      jsentry.put("content", jscontent);
View Full Code Here

   
    JSONObject jscontent = new JSONObject();
    if(entry.getContentElement() != null) {
       
        Content content = entry.getContentElement();
        Type type = entry.getContentType();
        if (type.equals(Content.Type.HTML) ||
            type.equals(Content.Type.XHTML) ||
            type.equals(Content.Type.TEXT)) {
          jscontent.put("type", type.toString());
        } else {
          jscontent.put("type", content.getMimeType().toString());
        }
        jscontent.put("value", content.getValue());
        jsentry.put("content", jscontent);
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Content.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.