/** * Check if a container element of the binding represents complex content. * * @param cont * @return <code>true</code> if complex content, <code>false</code> if not */ private static boolean isComplexContent(ContainerElementBase cont) { ArrayList contents = cont.getContentComponents(); for (int i = 0; i < contents.size(); i++) { Object item = contents.get(i); if (item instanceof IComponent && ((IComponent)item).hasName()) { return true; } else if (item instanceof ContainerElementBase && isComplexContent((ContainerElementBase)item)) { return true; } } return false; }
/** * Method called after completing code generation for the target class. This sets the object attributes, if needed. * * @param binding * @param holder */ public void finish(ElementBase binding, IClassHolder holder) { if (matchName(holder.getName()) && (m_postSetName != null || m_preSetName != null || m_preGetName != null)) { if (binding instanceof ContainerElementBase) { ContainerElementBase contain = (ContainerElementBase)binding; contain.setPostsetName(m_postSetName); contain.setPresetName(m_preSetName); contain.setPregetName(m_preGetName); } else { throw new IllegalStateException("Class " + holder.getFullName() + " is not a data class"); } } }
if (cont.isChoice()) { } else if (cont.isOrdered()) { ArrayList comps = cont.getContentComponents(); for (int i = offset; i < comps.size(); i++) { IComponent comp = (IComponent)comps.get(i); ContainerElementBase contain = (ContainerElementBase)comp; boolean iscoll = comp instanceof CollectionElement; if (contain.children().size() > 0) { if ((cont.isOrdered() || cont.isChoice()) && cdef.getParticleList().size() == 1) { Object child = cdef.getParticleList().get(0); if (child instanceof CommonCompositorDefinition) {
m_bindingElement.setChoice(true); m_bindingElement.setOrdered(false);
ArrayList comps = cont.getAttributeComponents(); for (int i = 0; i < comps.size(); i++) { IComponent comp = (IComponent)comps.get(i); if (contain.children().size() > 0) {
setName(child.getQName(), holder, struct); struct.setUsage(PropertyAttributes.OPTIONAL_USAGE); bindcomp.addChild(struct); bindcomp.addChild(struct); wrapcomp.addChild(collect); newcomp = collect; newname = subparent.getQName(); wrapcomp.addChild(struct); wrapcomp = struct; if (!empty && bindcomp.type() == ElementBase.COLLECTION_ELEMENT && getSchemaCustom().getRepeatType() != SchemaRootBase.REPEAT_ARRAY) { value.setSetName(((LeafNode)nested).getSetMethodName()); setValueHandlingOptions(item, value, holder); wrapcomp.addChild(value); if (SchemaUtils.isOptionalAttribute((AttributeElement)comp)) { value.setUsage(PropertyAttributes.OPTIONAL_USAGE); wrapcomp.addChild(struct); newcomp = struct; newname = null; setName(newname, holder, newcomp); newname = null; wrapcomp.addChild(newcomp);
ArrayList childs = cont.children(); for (int i = 0; i < childs.size(); i++) { Object child = childs.get(i);
contents = contain.getContentComponents(); for (int j = 0; j < contents.size(); j++) { IComponent comp = (IComponent)contents.get(j);