Code example for Element

Methods: getChild, setEndElementListener

0
		Element speakersElement = root.getChild(TAG_PLENUM_SPEAKER_SPEAKERS);
		// speakers 
		final PlenumSpeakerItemObject plenumSpeakerItemObject = new PlenumSpeakerItemObject();
		final List<PlenumSpeakerItemObject> speakers = new ArrayList<PlenumSpeakerItemObject>();
 
		Element groupsElement = speakersElement
				.getChild(TAG_PLENUM_SPEAKER_SPEAKER_ITEM);
		groupsElement.setEndElementListener(new EndElementListener() {
			public void end() { 
				speakers.add(plenumSpeakerItemObject.copy());
			} 
		}); 
 
		groupsElement.getChild(TAG_PLENUM_SPEAKER_SPEAKER_ITEM_TOPIC)
				.setEndTextElementListener(new EndTextElementListener() {
					public void end(String body) {
						plenumSpeakerItemObject.setTopic(body);
					} 
				}); 
		groupsElement.getChild(TAG_PLENUM_SPEAKER_SPEAKER_ITEM_STARTTIME)
				.setEndTextElementListener(new EndTextElementListener() {
					public void end(String body) {
						plenumSpeakerItemObject.setStartTime(body);
					} 
				}); 
		groupsElement.getChild(TAG_PLENUM_SPEAKER_SPEAKER_ITEM_STATE)
				.setEndTextElementListener(new EndTextElementListener() {
					public void end(String body) {
						plenumSpeakerItemObject.setState(body);
					} 
				}); 
		groupsElement.getChild(TAG_PLENUM_SPEAKER_SPEAKER_ITEM_FUNCTION)
				.setEndTextElementListener(new EndTextElementListener() {
					public void end(String body) {
						plenumSpeakerItemObject.setFunction(body);
					} 
				}); 
		groupsElement.getChild(TAG_PLENUM_SPEAKER_SPEAKER_ITEM_NAME)
				.setEndTextElementListener(new EndTextElementListener() {
					public void end(String body) {
						plenumSpeakerItemObject.setName(body);
					} 
				});