Package org.apache.abdera.ext.serializer.annotation

Examples of org.apache.abdera.ext.serializer.annotation.Link


                           ObjectContext objectContext,
                           SerializationContext context,
                           Conventions conventions) {

        StreamWriter sw = context.getStreamWriter();
        Link _link = objectContext.getAnnotation(Link.class);

        String rel = null;
        AccessibleObject accessor = objectContext.getAccessor(Rel.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value != null)
                rel = toString(value);
        }
        if (rel == null) {
            Rel _rel = objectContext.getAnnotation(Rel.class);
            if (_rel != null && !_rel.value().equals(DEFAULT)) {
                rel = _rel.value();
            }
        }
        if (rel == null && _link != null && !_link.rel().equals(DEFAULT)) {
            rel = _link.rel();
        }
        if (rel != null)
            sw.writeAttribute("rel", rel);

        String type = null;
        accessor = objectContext.getAccessor(MediaType.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value != null)
                type = toString(value);
        }
        if (type == null) {
            MediaType _type = objectContext.getAnnotation(MediaType.class);
            if (_type != null && !_type.value().equals(DEFAULT)) {
                type = _type.value();
            }
        }
        if (type == null && _link != null && !_link.type().equals(DEFAULT)) {
            type = _link.type();
        }
        if (type != null)
            sw.writeAttribute("type", type);

        String title = null;
        accessor = objectContext.getAccessor(Title.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value != null)
                title = toString(value);
        }
        if (title == null && _link != null && !_link.title().equals(DEFAULT)) {
            title = _link.title();
        }
        if (title != null)
            sw.writeAttribute("title", title);

        String hreflang = null;
        accessor = objectContext.getAccessor(HrefLanguage.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value != null)
                hreflang = toString(value);
        }
        if (hreflang == null) {
            HrefLanguage _hreflang = objectContext.getAnnotation(HrefLanguage.class);
            if (_hreflang != null && !_hreflang.value().equals(DEFAULT)) {
                hreflang = _hreflang.value();
            }
        }
        if (hreflang == null && _link != null && !_link.hreflang().equals(DEFAULT)) {
            hreflang = _link.hreflang();
        }
        if (hreflang != null)
            sw.writeAttribute("hreflang", hreflang);

        String href = null;
View Full Code Here


    ObjectContext objectContext,
    SerializationContext context,
    Conventions conventions) {
   
    StreamWriter sw = context.getStreamWriter();
    Link _link = objectContext.getAnnotation(Link.class);
   
    String rel = null;
    AccessibleObject accessor = objectContext.getAccessor(Rel.class, conventions);
    if (accessor != null) {
      Object value = eval(accessor, source);
      if (value != null)
        rel = toString(value);
    }
    if (rel == null) {
      Rel _rel = objectContext.getAnnotation(Rel.class);
      if (_rel != null && !_rel.value().equals(DEFAULT)) {
        rel = _rel.value();
      }
    }
    if (rel == null && _link != null && !_link.rel().equals(DEFAULT)) {
      rel = _link.rel();
    }
    if (rel != null)
      sw.writeAttribute("rel", rel);

    String type = null;
    accessor = objectContext.getAccessor(MediaType.class, conventions);
    if (accessor != null) {
      Object value = eval(accessor, source);
      if (value != null)
        type = toString(value);
    }
    if (type == null) {
      MediaType _type = objectContext.getAnnotation(MediaType.class);
      if (_type != null && !_type.value().equals(DEFAULT)) {
        type = _type.value();
      }
    }
    if (type == null && _link != null && !_link.type().equals(DEFAULT)) {
      type = _link.type();
    }
    if (type != null)
      sw.writeAttribute("type", type);
   
   
    String title = null;
    accessor = objectContext.getAccessor(Title.class, conventions);
    if (accessor != null) {
      Object value = eval(accessor, source);
      if (value != null)
        title = toString(value);
    }
    if (title == null && _link != null && !_link.title().equals(DEFAULT)) {
      title = _link.title();
    }
    if (title != null)
      sw.writeAttribute("title", title);

   
    String hreflang = null;
    accessor = objectContext.getAccessor(HrefLanguage.class, conventions);
    if (accessor != null) {
      Object value = eval(accessor, source);
      if (value != null)
        hreflang = toString(value);
    }
    if (hreflang == null) {
      HrefLanguage _hreflang = objectContext.getAnnotation(HrefLanguage.class);
      if (_hreflang != null && !_hreflang.value().equals(DEFAULT)) {
        hreflang = _hreflang.value();
      }
    }
    if (hreflang == null && _link != null && !_link.hreflang().equals(DEFAULT)) {
      hreflang = _link.hreflang();
    }
    if (hreflang != null)
      sw.writeAttribute("hreflang", hreflang);
   
    String href = null;
View Full Code Here

TOP

Related Classes of org.apache.abdera.ext.serializer.annotation.Link

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.