01: package org.conform.mdl;
02:
03: import org.xml.sax.*;
04:
05: import java.beans.ExceptionListener;
06:
07: import org.conform.*;
08:
09: public class RelationPropertyHandler extends ScopeHandler {
10: private String propertyName;
11:
12: public RelationPropertyHandler(ExceptionListener exceptionListener) {
13: super (exceptionListener);
14: }
15:
16: public void startElement(String name, AttributeList attributes)
17: throws SAXException {
18: if (!"relation-property".equals(name))
19: exceptionListener.exceptionThrown(new SAXParseException(
20: "relation-property doesn't have nested elements",
21: locator));
22: propertyName = null;
23: }
24:
25: public void endElement(String name) throws SAXException {
26: if ("relation-property".equals(name)) {
27: ((PropertyMeta) getScope()).setAttribute(
28: "relation-property", propertyName);
29: }
30: }
31:
32: public void characters(char ch[], int start, int length)
33: throws SAXException {
34: propertyName = new String(ch, start, length);
35: }
36: }
|