return new ObjectType(klass.getName());
/** * Reads the next {@link ObjectType} from source. * * @return The type * @throws IllegalStateException If the descriptor is invalid */ public ObjectType readObjectType() { final int start = this.current; this.advance(); while (this.hasNext() && this.peek() != ';') { this.advance(); } if (this.peek() != ';') throw new IllegalStateException("Incomplete descriptor provided!"); this.advance(); return new ObjectType(this.source.substring(start + 1, this.current - 1)); }
private static FieldType handleNonePrefix(final FieldType type) { if (type instanceof ArrayType) { final ArrayType arr = (ArrayType) type; return new ArrayType(arr.getDimCount(), handleNonePrefix(arr.getComponent())); } if (type instanceof ObjectType) { final ObjectType obj = (ObjectType) type; return new ObjectType(handleNonePrefix(obj.getClassName())); } return type; }
private static FieldType handleNonePrefix(final FieldType type) { if (type instanceof ArrayType) { final ArrayType arr = (ArrayType) type; return new ArrayType(arr.getDimCount(), handleNonePrefix(arr.getComponent())); } if (type instanceof ObjectType) { final ObjectType obj = (ObjectType) type; return new ObjectType(handleNonePrefix(obj.getClassName())); } return type; }