Code example for RootElement

Methods: getChild, getContentHandler

0
	 * Parse a plenum simple (Plenum) object. 
	 */ 
	public PlenumSimpleObject parseSimpleObject(String simpleURL) {
		final PlenumSimpleObject currentPlenumObject = new PlenumSimpleObject();
 
		RootElement root = new RootElement(TAG_PLENUM_SIMPLE_ROOT_ELEMENT);
		root.getChild(TAG_PLENUM_SIMPLE_DATE).setEndTextElementListener(
				new EndTextElementListener() {
					public void end(String body) {
						currentPlenumObject.setDate(body);
					} 
				}); 
		root.getChild(TAG_PLENUM_SIMPLE_TITLE).setEndTextElementListener(
				new EndTextElementListener() {
					public void end(String body) {
						currentPlenumObject.setTitle(body);
					} 
				}); 
		root.getChild(TAG_PLENUM_SIMPLE_TEXT).setEndTextElementListener(
				new EndTextElementListener() {
					public void end(String body) {
						currentPlenumObject.setText(body);
					} 
				}); 
 
		this.setSpecificParserURL(simpleURL);
		try { 
			Xml.Encoding encoding = ParseEncodingDetector
					.detectEncoding(getDetailsXMLURL()); 
			Xml.parse(this.getSpecificInputStream(), encoding,
					root.getContentHandler());
		} catch (Exception e) {
			throw new RuntimeException(e);
		} 
 
		return currentPlenumObject;