attributeType.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new Immutable(Config.ConfigAttr.class);
}
public Object endElement(Object o, QName name, ElementBinding element)
{
Immutable imm = (Immutable)o;
return imm.newInstance();
}
}
);
attributeType.setSimpleType(new CharactersHandler(){
public void setValue(QName qName, ElementBinding element, Object owner, Object value)
{
Immutable imm = (Immutable)owner;
Config.ConfigAttr.ConfigAttrDataValue o = new Config.ConfigAttr.ConfigAttrDataValue();
o.setData((String)value);
imm.addChild(qName.getLocalPart(), o);
}
});
attributeType.pushInterceptor(new QName("value1"), new DefaultElementInterceptor()
{
public void add(Object parent, Object child, QName name)
{
Immutable imm = (Immutable)parent;
Config.ConfigAttr.ConfigAttrValue1 value1 = (Config.ConfigAttr.ConfigAttrValue1)child;
imm.addChild(name.getLocalPart(), value1);
}
}
);
attributeType.pushInterceptor(new QName("value2"), new DefaultElementInterceptor()
{
public void add(Object parent, Object child, QName name)
{
Immutable imm = (Immutable)parent;
Config.ConfigAttr.ConfigAttrValue2 value2 = (Config.ConfigAttr.ConfigAttrValue2)child;
imm.addChild(name.getLocalPart(), value2);
}
}
);
attributeValue1Type.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new Config.ConfigAttr.ConfigAttrValue1();
}
}
);
attributeValue1Type.pushInterceptor(new QName("property"), new DefaultElementInterceptor()
{
public void characters(Object o, QName name, TypeBinding type, NamespaceContext nsCtx, String text)
{
Config.ConfigAttr.ConfigAttrValue1 value1 = (Config.ConfigAttr.ConfigAttrValue1)o;
value1.setProperty(text);
}
}
);
attributeValue2Type.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new Config.ConfigAttr.ConfigAttrValue2();
}
}
);
attributeValue2Type.setSimpleType(new CharactersHandler(){
public void setValue(QName qName, ElementBinding element, Object owner, Object value)
{
Config.ConfigAttr.ConfigAttrValue2 value2 = (Config.ConfigAttr.ConfigAttrValue2)owner;
value2.setValue2((String)value);
}
});
beansType.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new ArrayList();
}
}
);
beansType.pushInterceptor(new QName("bean"), new DefaultElementInterceptor()
{
public void add(Object parent, Object child, QName name)
{
Collection<Bean> beans = (Collection<Bean>)parent;
Config.Bean bean = (Config.Bean)child;
beans.add(bean);
}
}
);
beanType.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new Immutable(Config.Bean.class);
}
public Object endElement(Object o, QName name, ElementBinding element)
{
Immutable imm = (Immutable)o;
Config.Bean bean = (Config.Bean)imm.newInstance();
return bean;
}
}
);
beanType.pushInterceptor(new QName("name"), new DefaultElementInterceptor()
{
public void characters(Object o, QName name, TypeBinding type, NamespaceContext nsCtx, String text)
{
Immutable imm = (Immutable)o;
imm.addChild(name.getLocalPart(), text);
}
}
);
listType.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new ArrayList();
}
}
);
listType.pushInterceptor(new QName("value"), new DefaultElementInterceptor()
{
public void add(Object parent, Object child, QName name)
{
Collection<ListValue> list = (Collection<ListValue>)parent;
Config.ListValue value = (Config.ListValue)child;
list.add(value);
}
}
);
listType.pushInterceptor(new QName("depends"), new DefaultElementInterceptor()
{
public void add(Object parent, Object child, QName name)
{
Collection<Depends> list = (Collection<Depends>)parent;
Config.Depends depends = (Config.Depends)child;
list.add(depends);
}
}
);
listType.pushInterceptor(new QName("list"), new DefaultElementInterceptor()
{
public void add(Object parent, Object child, QName name)
{
Collection<Collection<?>> list = (Collection<Collection<?>>)parent;
Collection<?> sublist = (Collection<?>)child;
list.add(sublist);
}
}
);
listValueType.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new Immutable(Config.ListValue.class);
}
public void attributes(Object o,
QName elementName,
ElementBinding element,
Attributes attrs,
NamespaceContext nsCtx)
{
Immutable imm = (Immutable)o;
for(int i = 0; i < attrs.getLength(); ++i)
{
String lName = attrs.getLocalName(i);
if("type".equals(lName))
{
imm.addChild(lName, attrs.getValue(i));
}
}
}
public Object endElement(Object o, QName name, ElementBinding element)
{
Immutable imm = (Immutable)o;
Config.ListValue value = (Config.ListValue)imm.newInstance();
return value;
}
}
);
listValueType.setSimpleType(new CharactersHandler(){
public void setValue(QName qName, ElementBinding element, Object owner, Object value)
{
Immutable imm = (Immutable)owner;
imm.addChild(qName.getLocalPart(), value);
}
});
listDependsType.setHandler(new DefaultElementHandler()
{
public Object startElement(Object parent, QName name, ElementBinding element)
{
return new Immutable(Config.Depends.class);
}
public void attributes(Object o,
QName elementName,
ElementBinding element,
Attributes attrs,
NamespaceContext nsCtx)
{
Immutable imm = (Immutable)o;
for(int i = 0; i < attrs.getLength(); ++i)
{
String lName = attrs.getLocalName(i);
if("value".equals(lName))
{
imm.addChild(lName, attrs.getValue(i));
}
}
}
public Object endElement(Object o, QName name, ElementBinding element)
{
Immutable imm = (Immutable)o;
Config.Depends depends = (Config.Depends)imm.newInstance();
return depends;
}
}
);