private void calcRef() { // we can't do this eagerly because of a cyclic dependency ref = owner.parent.builder.getTypeInfo(type,owner); assert ref!=null; }
public NonElement<T,C> getTarget(T type) { assert parent.builder!=null : "this method must be called during the build stage"; return parent.builder.getTypeInfo(type,this); } }
public NonElement<T,C> getTarget() { if(type==null) { assert parent.builder!=null : "this method must be called during the build stage"; type = parent.builder.getTypeInfo(getIndividualType(),this); } return type; }
/** * This method is used to add a root reference to a model. */ public NonElement<T,C> getTypeInfo(Ref<T,C> ref) { // TODO: handle XmlValueList assert !ref.valueList; C c = nav.asDecl(ref.type); if(c!=null && reader.getClassAnnotation(XmlRegistry.class,c,null/*TODO: is this right?*/)!=null) { if(!registries.containsKey(nav.getPackageName(c))) addRegistry(c,null); return null; // TODO: is this correct? } else return getTypeInfo(ref.type,null); }
/** * @param clazz * @param type * clazz and type should both point to the enum class * that this {@link EnumLeafInfo} represents. * Because of the type parameterization we have to take them separately. */ public EnumLeafInfoImpl(ModelBuilder<T,C,F,M> builder, Locatable upstream, C clazz, T type ) { super(builder,upstream); this.clazz = clazz; this.type = type; elementName = parseElementName(clazz); // compute the type name // TODO: I guess it must be allowed for enums to have @XmlElement typeName = parseTypeName(clazz); // locate the base type. // this can be done eagerly because there shouldn't be no cycle. XmlEnum xe = builder.reader.getClassAnnotation(XmlEnum.class, clazz, this); if(xe!=null) { T base = builder.reader.getClassValue(xe, "value"); baseType = builder.getTypeInfo(base,this); } else { baseType = builder.getTypeInfo(builder.nav.ref(String.class),this); } }
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); }
builder.getTypeInfo(nav.getReturnType(m), new MethodLocatable<M>(this,m,nav)));
private void calcRef() { // we can't do this eagerly because of a cyclic dependency ref = owner.parent.builder.getTypeInfo(type,owner); assert ref!=null; }
public NonElement<T,C> getTarget(T type) { assert parent.builder!=null : "this method must be called during the build stage"; return parent.builder.getTypeInfo(type,this); } }
if(sa!=null) { for( T t : reader.getClassArrayValue(sa,"value") ) { getTypeInfo(t,(Locatable)sa);
public NonElement<T,C> getTarget() { if(type==null) { assert parent.builder!=null : "this method must be called during the build stage"; type = parent.builder.getTypeInfo(getIndividualType(),this); } return type; }
if(list==null) { isCollection = false; contentType = builder.getTypeInfo(tOfJAXBElementT,this); // suck this type into the current set. } else { isCollection = true; contentType = builder.getTypeInfo(nav().getTypeArgument(list,0),this); contentType = builder.getTypeInfo(this.adapter.defaultType,this); isCollection = false;
/** * This method is used to add a root reference to a model. */ public NonElement<T,C> getTypeInfo(Ref<T,C> ref) { // TODO: handle XmlValueList assert !ref.valueList; C c = nav.asDecl(ref.type); if(c!=null && reader.getClassAnnotation(XmlRegistry.class,c,null/*TODO: is this right?*/)!=null) { if(!registries.containsKey(nav.getPackageName(c))) addRegistry(c,null); return null; // TODO: is this correct? } else return getTypeInfo(ref.type,null); }
/** * @param clazz * @param type * clazz and type should both point to the enum class * that this {@link EnumLeafInfo} represents. * Because of the type parameterization we have to take them separately. */ public EnumLeafInfoImpl(ModelBuilder<T,C,F,M> builder, Locatable upstream, C clazz, T type ) { super(builder,upstream); this.clazz = clazz; this.type = type; elementName = parseElementName(clazz); // compute the type name // TODO: I guess it must be allowed for enums to have @XmlElement typeName = parseTypeName(clazz); // locate the base type. // this can be done eagerly because there shouldn't be no cycle. XmlEnum xe = builder.reader.getClassAnnotation(XmlEnum.class, clazz, this); if(xe!=null) { T base = builder.reader.getClassValue(xe, "value"); baseType = builder.getTypeInfo(base,this); } else { baseType = builder.getTypeInfo(builder.nav.ref(String.class),this); } }
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); }
builder.getTypeInfo(nav.getReturnType(m), new MethodLocatable<M>(this,m,nav)));
private void calcRef() { // we can't do this eagerly because of a cyclic dependency ref = owner.parent.builder.getTypeInfo(type,owner); assert ref!=null; }
public NonElement<T,C> getTarget() { if(type==null) { assert parent.builder!=null : "this method must be called during the build stage"; type = parent.builder.getTypeInfo(getIndividualType(),this); } return type; }
if(sa!=null) { for( T t : reader.getClassArrayValue(sa,"value") ) { getTypeInfo(t,(Locatable)sa);
if(list==null) { isCollection = false; contentType = builder.getTypeInfo(tOfJAXBElementT,this); // suck this type into the current set. } else { isCollection = true; contentType = builder.getTypeInfo(nav().getTypeArgument(list,0),this); contentType = builder.getTypeInfo(this.adapter.defaultType,this); isCollection = false;