int magnitude= getIntValue(attributes, RESULT);
long magnitude= getLongValue(attributes, RESULT);
	public MeteringSession parse(InputSource source) throws IOException {		try {			DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();			factory.setValidating(false);			DocumentBuilder parser= factory.newDocumentBuilder();			parser.setErrorHandler(new ErrorHandler() {				public void warning(SAXParseException exception) throws SAXException {				}				public void error(SAXParseException exception) throws SAXException {				}				public void fatalError(SAXParseException exception) throws SAXException {				}			});			Document document= parser.parse(source);						NodeList elements= document.getElementsByTagName(RUN);			if (elements.getLength() != 1)				return malformedInputResult();						Map properties= new HashMap();			Node node= elements.item(0);			NamedNodeMap attributes= node.getAttributes();			for (int i= 0; i < PROPERTIES.length; i++) {				properties.put(PROPERTIES[i], getStringValue(attributes, PROPERTIES[i], null));			}						List datapoints= new ArrayList();			elements= document.getElementsByTagName(STEP);			int length= elements.getLength();			for (int i= 0; i < length; i++) {				node= elements.item(i);				attributes= node.getAttributes();				String id= getStringValue(attributes, ID, null);				if (id == null)					return malformedInputResult();								Map scalars= new HashMap();				for (Node value= node.getFirstChild(); value != null; value= value.getNextSibling()) {					if (value.getNodeType() != Node.ELEMENT_NODE || !value.getNodeName().equals(VALUE))						continue;					attributes= value.getAttributes();					String dimension= getStringValue(attributes, WHAT);					int magnitude= getIntValue(attributes, RESULT);					scalars.put(dimension, new Scalar(dimension, magnitude));				}								datapoints.add(new DataPoint(id, scalars));			}						MeteringSession session= new MeteringSession(properties, datapoints);			return session;					} catch (ParserConfigurationException e) {			Assert.isTrue(false);		} catch (SAXException e) {			Throwable t= e.getCause();			if (t instanceof IOException)				throw (IOException) t;			else				throw new IOException(t == null ? e.getMessage() : t.getMessage());		}						return null;	}