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

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


                           ObjectContext objectContext,
                           SerializationContext context,
                           Conventions conventions) {
        writeAttributes(source, objectContext, context, conventions);
        StreamWriter sw = context.getStreamWriter();
        Generator _generator = objectContext.getAnnotation(Generator.class);

        String uri = null;
        AccessibleObject accessor = objectContext.getAccessor(URI.class, conventions);
        if (accessor != null) {
            Object value = eval(accessor, source);
            if (value != null)
                uri = toString(value);
        }
        if (uri == null) {
            URI _uri = objectContext.getAnnotation(URI.class);
            if (_uri != null && !_uri.value().equals(DEFAULT)) {
                uri = _uri.value();
            }
        }
        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);
            if (value != null)
                version = toString(value);
        }
        if (version == null) {
            URI _version = objectContext.getAnnotation(URI.class);
            if (_version != null && !_version.value().equals(DEFAULT)) {
                version = _version.value();
            }
        }
        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


    ObjectContext objectContext,
    SerializationContext context,
    Conventions conventions) {
      writeAttributes(source, objectContext, context, conventions);
      StreamWriter sw = context.getStreamWriter();
      Generator _generator = objectContext.getAnnotation(Generator.class);

      String uri = null;
      AccessibleObject accessor = objectContext.getAccessor(URI.class, conventions);
      if (accessor != null) {
        Object value = eval(accessor, source);
        if (value != null)
          uri = toString(value);
      }
      if (uri == null) {
        URI _uri = objectContext.getAnnotation(URI.class);
        if (_uri != null && !_uri.value().equals(DEFAULT)) {
          uri = _uri.value();
        }
      }
      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);
        if (value != null)
          version = toString(value);
      }
      if (version == null) {
        URI _version = objectContext.getAnnotation(URI.class);
        if (_version != null && !_version.value().equals(DEFAULT)) {
          version = _version.value();
        }
      }
      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

TOP

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

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.