Package com.sun.xml.internal.bind.v2.model.runtime

Examples of com.sun.xml.internal.bind.v2.model.runtime.RuntimeReferencePropertyInfo


                    handlePropertyAttribute(attBuilder, propVar, beanClass, propAt, target, set);
                }
            } else if (prop instanceof RuntimeReferencePropertyInfo) {
               
                // Handle a reference to an <element> or choice of elements
                RuntimeReferencePropertyInfo propRef = (RuntimeReferencePropertyInfo) prop;
                for (RuntimeElement re : propRef.getElements()) {
                    RuntimeElementInfo rei = (RuntimeElementInfo) re;
                  
                    ElementParserBuilder elBuilder = classBuilder.expectElement(rei.getElementName());
                    JVar beanVar2 = elBuilder.passParentVariable(beanVar);
                   
View Full Code Here


                writeSimpleTypeElement(classBuilder,
                                       propv.getTarget(),
                                       propv.getAdapter(),
                                       var, true, rawType, c, jt);
            } else if (prop instanceof RuntimeReferencePropertyInfo) {
              RuntimeReferencePropertyInfo propRef = (RuntimeReferencePropertyInfo) prop;
//               
//              Set<? extends RuntimeElement> elements = propRef.getElements();
//              for (RuntimeElement re : elements) {
//                RuntimeElementInfo rei = (RuntimeElementInfo) re;
//                   
                // This is all probably less than ideal
                Type rawType = propRef.getRawType();
                String propName = JaxbUtil.getGetter(parentClass, propRef.getName(), rawType);
                   
                JBlock block = classBuilder.getCurrentBlock().block();
                JType mtype = model._ref(MarshallerImpl.class);
                JVar marshaller = block.decl(mtype, "marsh",
                    JExpr.cast(mtype, JExpr.direct("context").invoke("get").arg(JExpr.lit(MarshallerImpl.MARSHALLER))));
View Full Code Here

                    handlePropertyAttribute(attBuilder, propVar, beanClass, propAt, target, set);
                }
            } else if (prop instanceof RuntimeReferencePropertyInfo) {
               
                // Handle a reference to an <element> or choice of elements
                RuntimeReferencePropertyInfo propRef = (RuntimeReferencePropertyInfo) prop;
                for (RuntimeElement re : propRef.getElements()) {
                    RuntimeElementInfo rei = (RuntimeElementInfo) re;
                  
                    ElementParserBuilder elBuilder = classBuilder.expectElement(rei.getElementName());
                    JVar beanVar2 = elBuilder.passParentVariable(beanVar);
                   
View Full Code Here

                property.setXmlName(elementType.getTagName());
                property.setRequired(false);
                property.setNillable(false);
            }
        } else  if (runtimePropertyInfo instanceof RuntimeReferencePropertyInfo) {
            RuntimeReferencePropertyInfo referenceProperty = (RuntimeReferencePropertyInfo) runtimePropertyInfo;
            property.setXmlStyle(Property.XmlStyle.ELEMENT_REF);
            for (RuntimeElement re : referenceProperty.getElements()) {
                ElementMapping elementMapping;
                if (re instanceof RuntimeElementInfo) {
                    RuntimeElementInfo runtimeElement = (RuntimeElementInfo) re;
                    elementMapping = createXmlMapping(property, runtimeElement);
                } else {
                    RuntimeClassInfo runtimeClassInfo = (RuntimeClassInfo) re;
                    elementMapping = createXmlMapping(property, runtimeClassInfo);
                }
                property.getElementMappings().add(elementMapping);
            }
            property.setNillable(referenceProperty.isCollectionNillable());
            property.setXmlAny(referenceProperty.getWildcard() != null);
            property.setLax(referenceProperty.getWildcard() == WildcardMode.LAX);
            property.setMixed(referenceProperty.isMixed());
        } else if (runtimePropertyInfo instanceof RuntimeValuePropertyInfo) {
            property.setXmlStyle(Property.XmlStyle.VALUE);
            if (property.isCollection()) property.setXmlList(true);
        } else {
            throw new BuildException("Unknown property type " + runtimePropertyInfo.getClass().getName());
View Full Code Here

        return addGenericElement(parent.owner.getElementInfo(parent.getClazz(),new QName(nsUri,r.name())));
    }

    private boolean addGenericElement(XmlElementRef r, ReferencePropertyInfoImpl<T,C,F,M> info) {
        String nsUri = info.getEffectiveNamespaceFor(r);
        ElementInfo ei = parent.owner.getElementInfo(info.parent.getClazz(), new QName(nsUri, r.name()));
        types.add(ei);
        return true;
    }
View Full Code Here

        boolean nillable = false; // default value

        QName name = elem.getElementName();
        Namespace n = getNamespace(name.getNamespaceURI());
        ElementInfo ei;

        if (elem.getScope() != null) { // (probably) never happens
            ei = this.types.getElementInfo(elem.getScope().getClazz(), name);
        } else {
            ei = this.types.getElementInfo(null, name);
        }

        XmlElement xmlElem = ei.getProperty().readAnnotation(XmlElement.class);

        if (xmlElem == null) {
            nillable = false;
        } else {
            nillable = xmlElem.nillable();
View Full Code Here

     * TODO: this is not the proper place for this class to be in.
     */
    public static Transducer createTransducer(RuntimeNonElementRef ref) {
        Transducer t = ref.getTarget().getTransducer();
        RuntimePropertyInfo src = ref.getSource();
        ID id = src.id();

        if(id==ID.IDREF)
            return RuntimeBuiltinLeafInfoImpl.STRING;

        if(id==ID.ID)
View Full Code Here

            t.toElementRef(prop);
    }

    public ID id() {
        for( Ref t : refs ) {
            ID id = t.id();
            if(id!=ID.NONE)    return id;
        }
        return ID.NONE;
    }
View Full Code Here

     */
    private void addTypeName(NonElement<T, C> r) {
        QName t = r.getTypeName();
        if(t==null)     return;

        TypeInfo old = typeNames.put(t,r);
        if(old!=null) {
            // collision
            reportError(new IllegalAnnotationException(
                    Messages.CONFLICTING_XML_TYPE_MAPPING.format(r.getTypeName()),
                    old, r ));
View Full Code Here

            XmlList xl = ref.annotations.getAnnotation(XmlList.class);

            builder.getTypeInfo(new Ref<TypeMirror,TypeDeclaration>(builder,t,xjta,xl));
        }

        TypeInfoSet r = builder.link();
        if(r==null)     return null;

        if(additionalElementDecls==null)
            additionalElementDecls = Collections.emptyMap();
        else {
View Full Code Here

TOP

Related Classes of com.sun.xml.internal.bind.v2.model.runtime.RuntimeReferencePropertyInfo

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.