Package org.apache.abdera.writer

Examples of org.apache.abdera.writer.StreamWriter.writeAttribute()


        }
        if (uri == null && _generator != null && !_generator.uri().equals(DEFAULT)) {
            uri = _generator.uri();
        }
        if (uri != null)
            sw.writeAttribute("uri", uri);

        String version = null;
        accessor = objectContext.getAccessor(URI.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
View Full Code Here


        }
        if (version == null && _generator != null && !_generator.version().equals(DEFAULT)) {
            version = _generator.version();
        }
        if (version != null)
            sw.writeAttribute("version", version);

        writeTextValue(source, objectContext, context, conventions);
    }

}
View Full Code Here

        if (!(source instanceof Element))
            return;
        Element element = (Element)source;
        sw.startElement(element.getQName());
        for (QName attr : element.getAttributes())
            sw.writeAttribute(attr, element.getAttributeValue(attr));
        XPath xpath = context.getAbdera().getXPath();
        List<?> children = xpath.selectNodes("node()", element);
        for (Object child : children) {
            if (child instanceof Element) {
                process(child, new ObjectContext(child), context, conventions);
View Full Code Here

      StreamWriter sw = context.getStreamWriter();
      if (!(source instanceof Element)) return;
      Element element = (Element) source;
      sw.startElement(element.getQName());
      for (QName attr : element.getAttributes())
        sw.writeAttribute(
          attr,
          element.getAttributeValue(attr));
      XPath xpath = context.getAbdera().getXPath();
      List<?> children = xpath.selectNodes("node()", element);
      for (Object child : children) {
View Full Code Here

    }
    if (scheme == null && _category != null && !_category.scheme().equals(DEFAULT)) {
      scheme = _category.scheme();
    }
    if (scheme != null)
      sw.writeAttribute("scheme", scheme);

    String label = null;
    accessor = objectContext.getAccessor(Label.class, conventions);
    if (accessor != null) {
      Object value = eval(accessor, source);
View Full Code Here

    }
    if (label == null && _category != null && !_category.label().equals(DEFAULT)) {
      label = _category.label();
    }
    if (label != null)
      sw.writeAttribute("label", label);
   
    String term = null;
    accessor = objectContext.getAccessor(Value.class, conventions);
    if (accessor != null) {
      Object value = eval(accessor, source);
View Full Code Here

      if (value != null)
        term = toString(value);
    }
    if (term == null) term = toString(source);
    if (term != null)
      sw.writeAttribute("term", term);
   
    writeAttributes(source, objectContext, context, conventions);
    writeExtensions(source, objectContext, context, conventions);
  }
}
View Full Code Here

      if (mediatype == null) {
        MediaType mt = valueContext.getAnnotation(MediaType.class);
        mediatype = mt != null && !mt.value().equals(DEFAULT) ? mt.value() : null;
      }
      if (mediatype != null)
        sw.writeAttribute("type", mediatype);
      }
     
      switch(type) {
        case TEXT:
        case HTML:
View Full Code Here

    }
    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);
View Full Code Here

    }
    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) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.