/** * 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()); }
@Override public RuntimeEnumConstantImpl createEnumConstant(String name, String literal, Field constant, EnumConstantImpl<Type,Class,Field,Method> last) { T t; try { try { constant.setAccessible(true); } catch (SecurityException e) { // in case the constant is already accessible, swallow this error. // if the constant is indeed not accessible, we will get IllegalAccessException // in the following line, and that is not too late. } t = (T)constant.get(null); } catch (IllegalAccessException e) { // impossible, because this is an enum constant throw new IllegalAccessError(e.getMessage()); } B b = null; try { b = baseXducer.parse(literal); } catch (Exception e) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_XML_ENUM_VALUE.format(literal,baseType.getType().toString()), e, new FieldLocatable<Field>(this,constant,nav()) )); } parseMap.put(b,t); printMap.put(t,b); return new RuntimeEnumConstantImpl(this, name, literal, last); }
/** * 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()); }
protected void link() { super.link(); for (TypeRefImpl<TypeT, ClassDeclT> ref : getTypes() ) { ref.link(); } if(isValueList()) { // ugly test, because IDREF's are represented as text on the wire, // it's OK to be a value list in that case. if(id()!= ID.IDREF) { // check if all the item types are simple types // this can't be done when we compute types because // not all TypeInfos are available yet for (TypeRefImpl<TypeT,ClassDeclT> ref : types) { if(!ref.getTarget().isSimpleType()) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_NEEDS_SIMPLETYPE.format( nav().getTypeName(ref.getTarget().getType())), this )); break; } } } if(!isCollection()) parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } } }
/** * 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()); }
@Override public RuntimeEnumConstantImpl createEnumConstant(String name, String literal, Field constant, EnumConstantImpl<Type,Class,Field,Method> last) { T t; try { try { constant.setAccessible(true); } catch (SecurityException e) { // in case the constant is already accessible, swallow this error. // if the constant is indeed not accessible, we will get IllegalAccessException // in the following line, and that is not too late. } t = (T)constant.get(null); } catch (IllegalAccessException e) { // impossible, because this is an enum constant throw new IllegalAccessError(e.getMessage()); } B b = null; try { b = baseXducer.parse(literal); } catch (Exception e) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_XML_ENUM_VALUE.format(literal,baseType.getType().toString()), e, new FieldLocatable<Field>(this,constant,nav()) )); } parseMap.put(b,t); printMap.put(t,b); return new RuntimeEnumConstantImpl(this, name, literal, last); }
/** * 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()); }
protected void link() { super.link(); for (TypeRefImpl<TypeT, ClassDeclT> ref : getTypes() ) { ref.link(); } if(isValueList()) { // ugly test, because IDREF's are represented as text on the wire, // it's OK to be a value list in that case. if(id()!= ID.IDREF) { // check if all the item types are simple types // this can't be done when we compute types because // not all TypeInfos are available yet for (TypeRefImpl<TypeT,ClassDeclT> ref : types) { if(!ref.getTarget().isSimpleType()) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_NEEDS_SIMPLETYPE.format( nav().getTypeName(ref.getTarget().getType())), this )); break; } } } if(!isCollection()) parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } } }
@Override public RuntimeEnumConstantImpl createEnumConstant(String name, String literal, Field constant, EnumConstantImpl<Type,Class,Field,Method> last) { T t; try { try { constant.setAccessible(true); } catch (SecurityException e) { // in case the constant is already accessible, swallow this error. // if the constant is indeed not accessible, we will get IllegalAccessException // in the following line, and that is not too late. } t = (T)constant.get(null); } catch (IllegalAccessException e) { // impossible, because this is an enum constant throw new IllegalAccessError(e.getMessage()); } B b = null; try { b = baseXducer.parse(literal); } catch (Exception e) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_XML_ENUM_VALUE.format(literal,baseType.getType().toString()), e, new FieldLocatable<Field>(this,constant,nav()) )); } parseMap.put(b,t); printMap.put(t,b); return new RuntimeEnumConstantImpl(this, name, literal, last); }
@Override public RuntimeEnumConstantImpl createEnumConstant(String name, String literal, Field constant, EnumConstantImpl<Type,Class,Field,Method> last) { T t; try { try { constant.setAccessible(true); } catch (SecurityException e) { // in case the constant is already accessible, swallow this error. // if the constant is indeed not accessible, we will get IllegalAccessException // in the following line, and that is not too late. } t = (T)constant.get(null); } catch (IllegalAccessException e) { // impossible, because this is an enum constant throw new IllegalAccessError(e.getMessage()); } B b = null; try { b = baseXducer.parse(literal); } catch (Exception e) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_XML_ENUM_VALUE.format(literal,baseType.getType().toString()), e, new FieldLocatable<Field>(this,constant,nav()) )); } parseMap.put(b,t); printMap.put(t,b); return new RuntimeEnumConstantImpl(this, name, literal, last); }
protected void link() { super.link(); for (TypeRefImpl<TypeT, ClassDeclT> ref : getTypes() ) { ref.link(); } if(isValueList()) { // ugly test, because IDREF's are represented as text on the wire, // it's OK to be a value list in that case. if(id()!= ID.IDREF) { // check if all the item types are simple types // this can't be done when we compute types because // not all TypeInfos are available yet for (TypeRefImpl<TypeT,ClassDeclT> ref : types) { if(!ref.getTarget().isSimpleType()) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_NEEDS_SIMPLETYPE.format( nav().getTypeName(ref.getTarget().getType())), this )); break; } } } if(!isCollection()) parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } } }
protected void link() { super.link(); for (TypeRefImpl<TypeT, ClassDeclT> ref : getTypes() ) { ref.link(); } if(isValueList()) { // ugly test, because IDREF's are represented as text on the wire, // it's OK to be a value list in that case. if(id()!= ID.IDREF) { // check if all the item types are simple types // this can't be done when we compute types because // not all TypeInfos are available yet for (TypeRefImpl<TypeT,ClassDeclT> ref : types) { if(!ref.getTarget().isSimpleType()) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_NEEDS_SIMPLETYPE.format( nav().getTypeName(ref.getTarget().getType())), this )); break; } } } if(!isCollection()) parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } } }