contain.addChild(value);
} else if (m_mappedNames.get(tname) != null) {
// use mapping definition for class
StructureElement structure = new StructureElement();
structure.setUsageName("optional");
structure.setGetName(gname);
structure.setSetName(sname);
if (((String)m_mappedNames.get(tname)).length() == 0) {
// add a name for reference to abstract mapping
structure.setName(elementName(tname));
}
contain.addChild(structure);
if (m_verbose) {
nestingIndent(System.out);
System.out.println
("referenced existing binding for " + tname);
}
} else if (tname.endsWith("[]")) {
// array, only supported for mapped base type
String bname = tname.substring(0, tname.length()-2);
if (m_mappedNames.get(bname) == null) {
throw new JiBXException("Base element type " +
bname + " must be mapped");
} else {
StructureElement structure = new StructureElement();
structure.setUsageName("optional");
structure.setGetName(gname);
structure.setSetName(sname);
structure.setMarshallerName
("org.jibx.extras.TypedArrayMapper");
structure.setUnmarshallerName
("org.jibx.extras.TypedArrayMapper");
contain.addChild(structure);
}
} else {
// no defined handling, check collection vs. structure
ClassFile pcf = ClassCache.requireClassFile(tname);
StructureElementBase element;
if (pcf.isImplements("Ljava/util/List;")) {
// create a collection for list subclass
System.err.println("Warning: property " + pname +
" requires mapped implementation of item " +
"classes");
element = new CollectionElement();
element.setComment(" add details of collection " +
"items to complete binding definition ");
element.setGetName(gname);
element.setSetName(sname);
// specify factory method if just typed as interface
if ("java.util.List".equals(tname)) {
element.setFactoryName("org.jibx.runtime." +
"Utility.arrayListFactory");
}
} else if (pcf.isInterface() ||
m_ignoreNames.contains(tname)) {
// mapping reference with warning for interface
nestingIndent(System.err);
System.err.println("Warning: reference to " +
"interface or abstract class " + tname +
" requires mapped implementation");
element = new StructureElement();
element.setGetName(gname);
element.setSetName(sname);
} else {