private void parseBaseDirectoryArgument() throws ParseException, IOException { // Read the base directory name. readNextWord("base directory name"); reader.setBaseDir(file(nextWord)); readNextWord(); }
/** * Creates a new ConfigurationParser for the given URL. */ public ConfigurationParser(URL url) throws IOException { reader = new FileWordReader(url); readNextWord(); }
/** * Creates a new ConfigurationParser for the given String arguments, * with the given base directory. */ public ConfigurationParser(String[] args, File baseDir) throws IOException { reader = new ArgumentWordReader(args, baseDir); readNextWord(); }
private int parseClassVersion() throws ParseException, IOException { // Read the obligatory target. readNextWord("java version"); int classVersion = ClassUtil.internalClassVersion(nextWord); if (classVersion == 0) { throw new ParseException("Unsupported java version " + reader.locationDescription()); } readNextWord(); return classVersion; }
/** * Reads the next word of the configuration in the 'nextWord' field, * throwing an exception if there is no next word. */ private void readNextWord(String expectedDescription, boolean expectingAtCharacter) throws ParseException, IOException { readNextWord(); if (configurationEnd(expectingAtCharacter)) { throw new ParseException("Expecting " + expectedDescription + " before " + reader.locationDescription()); } }
/** * Checks whether the given word is a valid Java identifier and throws * a ParseException if it isn't. Wildcard characters are accepted. */ private void checkJavaIdentifier(String expectedDescription) throws ParseException { if (!isJavaIdentifier(nextWord)) { throw new ParseException("Expecting " + expectedDescription + " before " + reader.locationDescription()); } }
/** * Throws a ParseException for an unexpected keyword. */ private int unknownAccessFlag() throws ParseException { throw new ParseException("Unexpected keyword " + reader.locationDescription()); }
MyClass myClass = ... ; //Get the instance myClass.feed( new InputReader() { @Override void readInput(InputStream is){ ... ; // Use at will without closing } });
/** * Returns whether the end of the configuration has been reached. */ private boolean configurationEnd() { return configurationEnd(false); }
private void parseBaseDirectoryArgument() throws ParseException, IOException { // Read the base directory name. readNextWord("base directory name", true, true, false); reader.setBaseDir(file(nextWord)); readNextWord(); }
/** * Throws a ParseException for an unexpected keyword. */ private int unknownAccessFlag() throws ParseException { throw new ParseException("Unexpected keyword " + reader.locationDescription()); }
/** * Creates a new ConfigurationParser for the given file. */ public ConfigurationParser(File file) throws IOException { reader = new FileWordReader(file); readNextWord(); }
private void parseBaseDirectoryArgument() throws ParseException, IOException { // Read the base directory name. readNextWord("base directory name", true, true, false); reader.setBaseDir(file(nextWord)); readNextWord(); }
/** * Throws a ParseException for an unexpected keyword. */ private int unknownAccessFlag() throws ParseException { throw new ParseException("Unexpected keyword " + reader.locationDescription()); }
private void parseBaseDirectoryArgument() throws ParseException, IOException { // Read the base directory name. readNextWord("base directory name", true, true, false); reader.setBaseDir(file(nextWord)); readNextWord(); }
/** * Throws a ParseException for an unexpected keyword. */ private int unknownAccessFlag() throws ParseException { throw new ParseException("Unexpected keyword " + reader.locationDescription()); }