public QName getTypeName(TypeReference tr) { try { NonElement<Type,Class> xt = getXmlType(getTypeInfoSet(),tr); if(xt==null) throw new IllegalArgumentException(); return xt.getTypeName(); } catch (IllegalAnnotationsException e) { // impossible given that JAXBRIContext has been successfully built in the first place throw new AssertionError(e); } }
/** * Checks the uniqueness of the type name. */ 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 )); } }
public void add( ArrayInfo<T,C> a ) { assert a!=null; final String namespaceURI = a.getTypeName().getNamespaceURI(); Namespace n = getNamespace(namespaceURI); n.arrays.add(a); // search for foreign namespace references n.addDependencyTo(a.getItemType().getTypeName()); }
/** * Adds an additional element declaration. * * @param tagName * The name of the element declaration to be added. * @param type * The type this element refers to. * Can be null, in which case the element refers to an empty anonymous complex type. */ public void add( QName tagName, boolean isNillable, NonElement<T,C> type ) { if(type!=null && type.getType()==navigator.ref(CompositeStructure.class)) return; // this is a special class we introduced for JAX-WS that we *don't* want in the schema Namespace n = getNamespace(tagName.getNamespaceURI()); n.elementDecls.put(tagName.getLocalPart(), n.new ElementWithType(isNillable,type)); // search for foreign namespace references if(type!=null) n.addDependencyTo(type.getTypeName()); }
public void add( EnumLeafInfo<T,C> envm ) { assert envm!=null; String nsUri = null; if(envm.isElement()) { // put element -> type reference nsUri = envm.getElementName().getNamespaceURI(); Namespace ns = getNamespace(nsUri); ns.enums.add(envm); ns.addDependencyTo(envm.getTypeName()); // schedule writing this global element add(envm.getElementName(),false,envm); } final QName typeName = envm.getTypeName(); if (typeName != null) { nsUri = typeName.getNamespaceURI(); } else { if(nsUri==null) return; // anonymous type } Namespace n = getNamespace(nsUri); n.enums.add(envm); // search for foreign namespace references n.addDependencyTo(envm.getBaseType().getTypeName()); }
public ArrayInfoImpl(ModelBuilder<TypeT,ClassDeclT,FieldT,MethodT> builder, Locatable upstream, TypeT arrayType) { super(builder, upstream); this.arrayType = arrayType; TypeT componentType = nav().getComponentType(arrayType); this.itemType = builder.getTypeInfo(componentType, this); QName n = itemType.getTypeName(); if(n==null) { builder.reportError(new IllegalAnnotationException(Messages.ANONYMOUS_ARRAY_ITEM.format( nav().getTypeName(componentType)),this)); n = new QName("#dummy"); // for error recovery } this.typeName = ArrayInfoUtil.calcArrayTypeName(n); }
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
public QName getTypeName(TypeReference tr) { try { NonElement<Type,Class> xt = getXmlType(getTypeInfoSet(),tr); if(xt==null) throw new IllegalArgumentException(); return xt.getTypeName(); } catch (IllegalAnnotationsException e) { // impossible given that JAXBRIContext has been successfully built in the first place throw new AssertionError(e); } }
/** * Checks the uniqueness of the type name. */ 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 )); } }
public void add( ArrayInfo<T,C> a ) { assert a!=null; final String namespaceURI = a.getTypeName().getNamespaceURI(); Namespace n = getNamespace(namespaceURI); n.arrays.add(a); // search for foreign namespace references n.addDependencyTo(a.getItemType().getTypeName()); }
/** * Adds an additional element declaration. * * @param tagName * The name of the element declaration to be added. * @param type * The type this element refers to. * Can be null, in which case the element refers to an empty anonymous complex type. */ public void add( QName tagName, boolean isNillable, NonElement<T,C> type ) { if(type!=null && type.getType()==navigator.ref(CompositeStructure.class)) return; // this is a special class we introduced for JAX-WS that we *don't* want in the schema Namespace n = getNamespace(tagName.getNamespaceURI()); n.elementDecls.put(tagName.getLocalPart(), n.new ElementWithType(isNillable,type)); // search for foreign namespace references if(type!=null) n.addDependencyTo(type.getTypeName()); }
public void add( EnumLeafInfo<T,C> envm ) { assert envm!=null; String nsUri = null; if(envm.isElement()) { // put element -> type reference nsUri = envm.getElementName().getNamespaceURI(); Namespace ns = getNamespace(nsUri); ns.enums.add(envm); ns.addDependencyTo(envm.getTypeName()); // schedule writing this global element add(envm.getElementName(),false,envm); } final QName typeName = envm.getTypeName(); if (typeName != null) { nsUri = typeName.getNamespaceURI(); } else { if(nsUri==null) return; // anonymous type } Namespace n = getNamespace(nsUri); n.enums.add(envm); // search for foreign namespace references n.addDependencyTo(envm.getBaseType().getTypeName()); }
public ArrayInfoImpl(ModelBuilder<TypeT,ClassDeclT,FieldT,MethodT> builder, Locatable upstream, TypeT arrayType) { super(builder, upstream); this.arrayType = arrayType; TypeT componentType = nav().getComponentType(arrayType); this.itemType = builder.getTypeInfo(componentType, this); QName n = itemType.getTypeName(); if(n==null) { builder.reportError(new IllegalAnnotationException(Messages.ANONYMOUS_ARRAY_ITEM.format( nav().getTypeName(componentType)),this)); n = new QName("#dummy"); // for error recovery } this.typeName = ArrayInfoUtil.calcArrayTypeName(n); }
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
public QName getXmlTypeName(Reference javaType) { NonElement<TypeMirror, TypeElement> ti = refMap.get(javaType); if(ti!=null) return ti.getTypeName(); return null; }
public QName getXmlTypeName(Reference javaType) { NonElement<TypeMirror,TypeDeclaration> ti = refMap.get(javaType); if(ti!=null) return ti.getTypeName(); return null; }
public QName getXmlTypeName(Reference javaType) { NonElement<TypeMirror, TypeElement> ti = refMap.get(javaType); if(ti!=null) return ti.getTypeName(); return null; }
public QName getXmlTypeName(Reference javaType) { NonElement<TypeMirror,TypeDeclaration> ti = refMap.get(javaType); if(ti!=null) return ti.getTypeName(); return null; }
public QName getTypeName(TypeReference tr) { try { NonElement<Type,Class> xt = getXmlType(getTypeInfoSet(),tr); if(xt==null) throw new IllegalArgumentException(); return xt.getTypeName(); } catch (IllegalAnnotationsException e) { // impossible given that JAXBRIContext has been successfully built in the first place throw new AssertionError(e); } }
public void add( ArrayInfo<T,C> a ) { assert a!=null; final String namespaceURI = a.getTypeName().getNamespaceURI(); Namespace n = getNamespace(namespaceURI); n.arrays.add(a); // search for foreign namespace references n.addDependencyTo(a.getItemType().getTypeName()); }