Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlAccessType


    return elements;
  }
 
  @Override public IJavaXMLElement getAnyElementHandler(ClassDescriptor<?> bean, JavaXMLBeanInitializationContext context) throws JAXBException {
    XmlAccessorType xatDecl = bean.getAnnotation(XmlAccessorType.class);
    XmlAccessType xat = xatDecl == null ? XmlAccessType.PUBLIC_MEMBER : xatDecl.value();
   
    List<IClassMemberWritableValue> members = this.filter( this.getMembers(bean, context), XmlAnyElement.class, xat );
   
    Iterator<IClassMemberWritableValue> it = members.iterator();
    while (it.hasNext()) {
View Full Code Here


    return members.size() == 1 ? this.createRealType(members.get(0), context) : null;
  }

  @Override public IJavaXMLContent getContentHandler(ClassDescriptor<?> bean, JavaXMLBeanInitializationContext context) throws JAXBException {
    XmlAccessorType xatDecl = bean.getAnnotation(XmlAccessorType.class);
    XmlAccessType xat = xatDecl == null ? XmlAccessType.PUBLIC_MEMBER : xatDecl.value();
   
    List<IClassMemberWritableValue> members = this.filter( this.getMembers(bean, context), XmlValue.class, xat );
   
    Iterator<IClassMemberWritableValue> it = members.iterator();
    while (it.hasNext()) {
View Full Code Here

        el.setSchemaTypeName(ct.getQName());

        XmlSchemaSequence seq = new XmlSchemaSequence();
        ct.setParticle(seq);
        String namespace = part.getElementQName().getNamespaceURI();
        XmlAccessType accessType = Utils.getXmlAccessType(cls);
//
        for (Field f : Utils.getFields(cls, accessType)) {
            //map field
            Type type = Utils.getFieldType(f);
            //we want to return the right type for collections so if we get null
View Full Code Here

    }
   
    private void buildGenericSeq(XmlSchema schema, XmlSchemaComplexType generics, Class<?> genericsClass) {
        XmlSchemaSequence genericsSeq = new XmlSchemaSequence();
        generics.setParticle(genericsSeq);
        XmlAccessType  accessType = Utils.getXmlAccessType(genericsClass);
       
        for (Field f : Utils.getFields(genericsClass, accessType)) {
            if (f.getGenericType() instanceof TypeVariable) {              
                String genericName = Character.toLowerCase(f.getName().charAt(0)) + f.getName().substring(1);
                XmlSchemaElement genericEle = new XmlSchemaElement(schema, false);
View Full Code Here

        XMLStreamWriter writer = getStreamWriter(source);
        QName qn = part.getElementQName();
        try {
            writer.writeStartElement("ns1", qn.getLocalPart(), qn.getNamespaceURI());
            Class<?> cls = part.getTypeClass();
            XmlAccessType accessType = Utils.getXmlAccessType(cls);
            String namespace = part.getElementQName().getNamespaceURI();
            String attNs = namespace;
           
            SchemaInfo sch = part.getMessageInfo().getOperation().getInterface()
                .getService().getSchema(namespace);
View Full Code Here

            } catch (NoSuchMethodException nse) {
                Constructor<?> cons = cls.getConstructor(new Class[] {String.class});
                obj = cons.newInstance(new Object[1]);
            }

            XmlAccessType accessType = Utils.getXmlAccessType(cls);
            reader.nextTag();
            while (reader.getEventType() == XMLStreamReader.START_ELEMENT) {
                QName q = reader.getName();
                String fieldName = q.getLocalPart();
                Field f = Utils.getField(cls, accessType, fieldName);
View Full Code Here

        //EXACT classes in the fields/methods if they are in a different package. Thus,
        //subclasses won't be found and the xsi:type stuff won't work at all.
        //We'll grab the public field/method types and then add the ObjectFactory stuff
        //as well as look for jaxb.index files in those packages.

        XmlAccessType accessType = Utils.getXmlAccessType(cls);

        if (accessType != XmlAccessType.PROPERTY) {   // only look for fields if we are instructed to
            //fields are accessible even if not public, must look at the declared fields
            //then walk to parents declared fields, etc...
            Field fields[] = ReflectionUtil.getDeclaredFields(cls);
View Full Code Here

        el.setSchemaTypeName(ct.getQName());

        XmlSchemaSequence seq = new XmlSchemaSequence();
        ct.setParticle(seq);
        String namespace = part.getElementQName().getNamespaceURI();
        XmlAccessType accessType = Utils.getXmlAccessType(cls);
//
        for (Field f : Utils.getFields(cls, accessType)) {
            //map field
            Type type = Utils.getFieldType(f);
            //we want to return the right type for collections so if we get null
View Full Code Here

        //EXACT classes in the fields/methods if they are in a different package. Thus,
        //subclasses won't be found and the xsi:type stuff won't work at all.
        //We'll grab the public field/method types and then add the ObjectFactory stuff
        //as well as look for jaxb.index files in those packages.

        XmlAccessType accessType = Utils.getXmlAccessType(cls);

        if (accessType != XmlAccessType.PROPERTY) {   // only look for fields if we are instructed to
            //fields are accessible even if not public, must look at the declared fields
            //then walk to parents declared fields, etc...
            Field fields[] = ReflectionUtil.getDeclaredFields(cls);
View Full Code Here

       
        XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
        if (accessorType == null && cls.getPackage() != null) {
            accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
        }
        XmlAccessType accessType = accessorType != null ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;

       
        for (Field f : cls.getDeclaredFields()) {
            if (JAXBContextInitializer.isFieldAccepted(f, accessType)) {
                //map field
View Full Code Here

TOP

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

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.