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

Examples of com.sun.xml.internal.bind.v2.model.core.Element


         *      type to be referenced.
         * @param refAttName
         *      The name of the attribute used when referencing a type by QName.
         */
        private void writeTypeRef(TypeHost th, NonElement<T,C> type, String refAttName) {
            Element e = null;
            if (type instanceof MaybeElement) {
                MaybeElement me = (MaybeElement)type;
                boolean isElement = me.isElement();
                if (isElement) e = me.asElement();
            }
            if (type instanceof Element) {
                e = (Element)type;
            }
            if (type.getTypeName()==null) {
                if ((e != null) && (e.getElementName() != null)) {
                    th.block(); // so that the caller may write other attributes
                    if(type instanceof ClassInfo) {
                        writeClass( (ClassInfo<T,C>)type, th );
                    } else {
                        writeEnum( (EnumLeafInfo<T,C>)type, (SimpleTypeHost)th);
View Full Code Here


                                e.ref(new QName(uri, tn.getLocalPart()));
                            } else {

                                QName elemName = null;
                                if (t.getTarget() instanceof Element) {
                                    Element te = (Element) t.getTarget();
                                    elemName = te.getElementName();
                                }

                                Collection<TypeInfo> refs = propInfo.ref();
                                TypeInfo ti;
                                if ((refs != null) && (!refs.isEmpty()) && (elemName != null)
View Full Code Here

         * &lt;element name='foo' type='t' /> to &lt;element ref='foo' />.
         *
         * This is possible if we already have such declaration to begin with.
         */
        private boolean canBeDirectElementRef(TypeRef<T, C> t, QName tn, TypeInfo parentInfo) {
            Element te = null;
            ClassInfo ci = null;
            QName targetTagName = null;

            if(t.isNillable() || t.getDefaultValue()!=null) {
                // can't put those attributes on <element ref>
                return false;
            }

            if (t.getTarget() instanceof Element) {
                te = (Element) t.getTarget();
                targetTagName = te.getElementName();
                if (te instanceof ClassInfo) {
                    ci = (ClassInfo)te;
                }
            }

            String nsUri = tn.getNamespaceURI();
            if ((!nsUri.equals(uri) && nsUri.length()>0) && (!((parentInfo instanceof ClassInfo) && (((ClassInfo)parentInfo).getTypeName() == null)))) {
                return true;
            }

            // there's a circular reference from an anonymous subtype to a global element
            if ((ci != null) && ((targetTagName != null) && (te.getScope() == null))) {
                if (targetTagName.getLocalPart().equals(tn.getLocalPart())) {
                    return true;
                }
            }

View Full Code Here

            if(t.isNillable() || t.getDefaultValue()!=null)
                // can't put those attributes on <element ref>
                return false;

            if(t.getTarget() instanceof Element) {
                Element te = (Element) t.getTarget();
                QName targetTagName = te.getElementName();
                return targetTagName!=null && targetTagName.equals(tn);
            }

            return false;
        }
View Full Code Here

            if(t.isNillable() || t.getDefaultValue()!=null)
                // can't put those attributes on <element ref>
                return false;

            if(t.getTarget() instanceof Element) {
                Element te = (Element) t.getTarget();
                QName targetTagName = te.getElementName();
                return targetTagName!=null && targetTagName.equals(tn);
            }

            return false;
        }
View Full Code Here

            if(t.isNillable() || t.getDefaultValue()!=null)
                // can't put those attributes on <element ref>
                return false;

            if(t.getTarget() instanceof Element) {
                Element te = (Element) t.getTarget();
                QName targetTagName = te.getElementName();
                return targetTagName!=null && targetTagName.equals(tn);
            }

            return false;
        }
View Full Code Here

            if(t.isNillable() || t.getDefaultValue()!=null)
                // can't put those attributes on <element ref>
                return false;

            if(t.getTarget() instanceof Element) {
                Element te = (Element) t.getTarget();
                QName targetTagName = te.getElementName();
                return targetTagName!=null && targetTagName.equals(tn);
            }

            return false;
        }
View Full Code Here

            if(t.isNillable() || t.getDefaultValue()!=null)
                // can't put those attributes on <element ref>
                return false;

            if(t.getTarget() instanceof Element) {
                Element te = (Element) t.getTarget();
                QName targetTagName = te.getElementName();
                return targetTagName!=null && targetTagName.equals(tn);
            }

            return false;
        }
View Full Code Here

            if(t.isNillable() || t.getDefaultValue()!=null)
                // can't put those attributes on <element ref>
                return false;

            if(t.getTarget() instanceof Element) {
                Element te = (Element) t.getTarget();
                QName targetTagName = te.getElementName();
                return targetTagName!=null && targetTagName.equals(tn);
            }

            return false;
        }
View Full Code Here

/* 1059 */       if ((t.isNillable()) || (t.getDefaultValue() != null))
/*      */       {
/* 1061 */         return false;
/*      */       }
/* 1063 */       if ((t.getTarget() instanceof Element)) {
/* 1064 */         Element te = (Element)t.getTarget();
/* 1065 */         QName targetTagName = te.getElementName();
/* 1066 */         return (targetTagName != null) && (targetTagName.equals(tn));
/*      */       }
/*      */
/* 1069 */       return false;
/*      */     }
View Full Code Here

TOP

Related Classes of com.sun.xml.internal.bind.v2.model.core.Element

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.