/** * Reads the next {@link BaseType} from source. * * @return The type * @throws IllegalStateException If the descriptor is invalid */ public BaseType readBaseType() { return BaseType.getFromKey(this.advance()); }
/** * Gets the {@link PrimitiveType} for the given type key. * * @param key The type key * @return The primitive type * @throws IllegalStateException If the descriptor is invalid */ static PrimitiveType getFromKey(char key) { if (key == 'V') { return VoidType.INSTANCE; } if (BaseType.isValidBase(key)) { return BaseType.getFromKey(key); } throw new IllegalStateException("Invalid primitive type: " + key); }