public String process() { if (this.type.getCanonicalName() == null) { // new RuntimeException( "Ignoring anonymous class: " + this.type // ).printStackTrace( ); } else { this.elem(Elem.mapping); if (this.abs) { this.attr("abstract", "true"); } else { this.attr("name", this.type.getSimpleName()) .attr("extends", this.type.getSuperclass().getCanonicalName()); } this.attr("class", this.type.getCanonicalName()); if (BindingFileSearch.INSTANCE.MSG_BASE_CLASS.isAssignableFrom(this.type.getSuperclass()) || BindingFileSearch.INSTANCE.MSG_DATA_CLASS.isAssignableFrom( this.type.getSuperclass())) { this.elem(Elem.structure) .attr("map-as", this.type.getSuperclass().getCanonicalName()) .end(); } for (Field f : this.type.getDeclaredFields()) { if (!Ats.from(f).has(Transient.class) || Modifier.isTransient(f.getModifiers())) { TypeBinding tb = getTypeBinding(f); if (!(tb instanceof NoopTypeBinding)) { // System.out.printf( "BOUND: %-70s [type=%s:%s]\n", // f.getDeclaringClass( ).getCanonicalName( ) +"."+ f.getName( ), tb.getTypeName( ), // f.getType( ).getCanonicalName( ) ); this.append(tb.toString()); } } } this.end(); } return this.toString(); }
public String process() { if (this.type.getCanonicalName() == null) { new RuntimeException("" + this.type).printStackTrace(); } else { this.elem(Elem.mapping); if (this.abs) { this.attr("abstract", "true"); } else { this.attr("name", this.type.getSimpleName()) .attr("extends", this.type.getSuperclass().getCanonicalName()); } this.attr("class", this.type.getCanonicalName()); if (BindingGenerator.MSG_TYPE.isAssignableFrom(this.type.getSuperclass()) || BindingGenerator.DATA_TYPE.isAssignableFrom(this.type.getSuperclass())) { this.elem(Elem.structure) .attr("map-as", this.type.getSuperclass().getCanonicalName()) .end(); } for (Field f : type.getDeclaredFields()) { TypeBinding tb = getTypeBinding(f); if (!(tb instanceof NoopTypeBinding)) { System.out.printf( "BOUND: %-70s [type=%s:%s]\n", f.getDeclaringClass().getCanonicalName() + "." + f.getName(), tb.getTypeName(), f.getType().getCanonicalName()); this.append(tb.toString()); } } this.end(); } return this.toString(); }