Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlAttribute


                }
            } else {
                LOG.warning("Schema associated with " + namespace + " is null");
            }
            for (Field f : Utils.getFields(cls, accessType)) {
                XmlAttribute at = f.getAnnotation(XmlAttribute.class);
                if (at == null) {
                    QName fname = new QName(namespace, f.getName());
                    ReflectionUtil.setAccessible(f);
                    if (JAXBSchemaInitializer.isArray(f.getGenericType())) {
                        writeArrayObject(marshaller, writer, fname, f.get(elValue));
View Full Code Here


  public AttributeMapping(JAXBContextImpl context, Accessor accessor)
    throws JAXBException
  {
    super(context, accessor);

    XmlAttribute attribute = accessor.getAnnotation(XmlAttribute.class);

    String name = accessor.getName();
    String namespace = null;

    if (attribute != null) {
      if (! attribute.name().equals("##default"))
        name = attribute.name();

      if (! attribute.namespace().equals("##default"))
        namespace = attribute.namespace();
    }

    if (namespace == null)
      _qname = new QName(name);
    else
View Full Code Here

        W3C_XML_SCHEMA_NS_URI);

    // See http://forums.java.net/jive/thread.jspa?messageID=167171
    // Primitives are always required

    XmlAttribute attribute = _accessor.getAnnotation(XmlAttribute.class);

    if (attribute.required() ||
        (_generateRICompatibleSchema && _accessor.getType().isPrimitive()))
      out.writeAttribute("use", "required");

    XmlID xmlID = _accessor.getAnnotation(XmlID.class);
View Full Code Here

  {
    XmlAnyAttribute xmlAnyAttribute =
      accessor.getAnnotation(XmlAnyAttribute.class);
    XmlAnyElement xmlAnyElement =
      accessor.getAnnotation(XmlAnyElement.class);
    XmlAttribute xmlAttribute =
      accessor.getAnnotation(XmlAttribute.class);
    XmlElement xmlElement =
      accessor.getAnnotation(XmlElement.class);
    XmlElementRef xmlElementRef =
      accessor.getAnnotation(XmlElementRef.class);
View Full Code Here

        // characterizing annotations. these annotations (or lack thereof) decides
        // the kind of the property it goes to.
        // I wish I could use an array...
        XmlTransient t = null;
        XmlAnyAttribute aa = null;
        XmlAttribute a = null;
        XmlValue v = null;
        XmlElement e1 = null;
        XmlElements e2 = null;
        XmlElementRef r1 = null;
        XmlElementRefs r2 = null;
View Full Code Here

    private final boolean isRequired;

    AttributePropertyInfoImpl(ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> parent, PropertySeed<TypeT,ClassDeclT,FieldT,MethodT> seed ) {
        super(parent,seed);
        XmlAttribute att = seed.readAnnotation(XmlAttribute.class);
        assert att!=null;

        if(att.required())
            isRequired = true;
        else isRequired = nav().isPrimitive(getIndividualType());

        this.xmlName = calcXmlName(att);
    }
View Full Code Here

TOP

Related Classes of javax.xml.bind.annotation.XmlAttribute

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.