/** * Return the informations contains in the PrjElement in parameter if it is * a PrjStringParameter. * * @param e the PrjElement to parse */ private String getString(PrjElement e) { if (e instanceof PrjStringElement) { PrjStringElement s = (PrjStringElement) e; return s.getValue().trim(); } throw new PrjParserException("Failed to parse PRJ. Found '" + e + "', expected some PrjStringElement."); }
/** * Read the informations contains in the PrjElement in parameter if it is a * PrjStringParameter and put it into the set of parameters. * * @param e the PrjElement to parse * @param name the key to use to put the string in the Map of parameters */ private void parseString(PrjElement e, String name) { if (e instanceof PrjStringElement) { PrjStringElement s = (PrjStringElement) e; params.put(name, s.getValue().trim()); } else { throw new PrjParserException("Failed to parse PRJ. Found '" + e + "', expected PrjStringElement with " + name + " in it."); } }