/** * Returns the base type of a given type with its symbol table. * This logic is extracted from JavaTypeWriter's constructor() method * for reusing. * * @param type * @param symbolTable * @return */ public static TypeEntry getBaseType(TypeEntry type, SymbolTable symbolTable) { Node node = type.getNode(); TypeEntry base = getComplexElementExtensionBase( node, symbolTable); if (base == null) { base = getComplexElementRestrictionBase(node, symbolTable); } if (base == null) { QName baseQName = getSimpleTypeBase(node); if (baseQName != null) { base = symbolTable.getType(baseQName); } } return base; }
if (isXSDNode(node, "element")) { NodeList children = node.getChildNodes(); int len = children.getLength(); if (isXSDNode(kid, "complexType")) { node = kid; if (isXSDNode(node, "complexType")) { if (isXSDNode(kid, "complexContent") || isXSDNode(kid, "simpleContent")) { content = kid; if (isXSDNode(kid, "extension") || isXSDNode(kid, "restriction")) { node = kid; if (isXSDNode(child, "attributeGroup")) { if (v == null) { v = new Vector(); addAttributeGroupToVector(v, child, symbolTable); } else if (isXSDNode(child, "anyAttribute")) { } else if (isXSDNode(child, "attribute")) { addAttributeToVector(v, child, symbolTable);
/** * If the specified node represents an array encoding of one of the following * forms, then return the qname repesenting the element type of the array. * * @param node is the node * @param dims is the output value that contains the number of dimensions if return is not null * @param itemQName will end up containing the "inner" QName for a * wrapped literal array * @return QName or null */ public static QName getArrayComponentQName(Node node, IntHolder dims, BooleanHolder underlTypeNillable, QNameHolder itemQName, BooleanHolder forElement, SymbolTable symbolTable) { dims.value = 1; // assume 1 dimension underlTypeNillable.value = false; // assume underlying type is not nillable QName qName = getCollectionComponentQName(node, itemQName, forElement, symbolTable); if (qName == null) { qName = getArrayComponentQName_JAXRPC(node, dims, underlTypeNillable, symbolTable); } return qName; }
boolean isSimpleList = SchemaUtils.isListWithItemType(node); } else { TypeEntry base = SchemaUtils.getComplexElementExtensionBase(node, symbolTable); base = SchemaUtils.getComplexElementRestrictionBase( node, symbolTable); QName baseQName = SchemaUtils.getSimpleTypeBase(node);
TypeEntry base = SchemaUtils.getBaseType(te, symbolTable); if (base == null) break; &&SchemaUtils.getComplexElementExtensionBase(te.getNode(), symbolTable) == null && te.getContainedAttributes() == null) { if(!SchemaUtils.isSimpleTypeWithUnion(te.getNode())) { if (base.isSimpleType()) { QName itemType = SchemaUtils.getListItemType(tEntry.getNode()); if (itemType != null) {
Vector v = SchemaUtils.getContainedElementDeclarations(node, symbolTable); v = SchemaUtils.getContainedAttributeTypes(node, symbolTable); TypeEntry extendType = SchemaUtils.getComplexElementExtensionBase(node, symbolTable);
if (isXSDNode(node, "element")) { NodeList children = node.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { if (isXSDNode(children.item(j), "simpleType")) { node = children.item(j); break; if (isXSDNode(node, "simpleType")) { NodeList children = node.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { if (isXSDNode(children.item(j), "list")) { Node listNode = children.item(j); org.w3c.dom.Element listElement = children = listNode.getChildNodes(); for (j = 0; j < children.getLength() && localType == null; j++) { if (isXSDNode(children.item(j), "simpleType")) { localType = children.item(j); return getSimpleTypeBase(localType);
if (SchemaUtils.isMixed(parent.getNode())) { parentIsMixed = true; SchemaUtils.getComplexElementExtensionBase(parent.getNode(), emitter.getSymbolTable()); if (enableMemberFields && SchemaUtils.isMixed(type.getNode())) { isMixed = true; if (!isAny && !parentIsAny && !parentIsMixed) {
/** * Get a TypeEntry for the base type of this type, if one exists. * * @param symbolTable a <code>SymbolTable</code> value * @return a <code>TypeEntry</code> value */ public TypeEntry getComplexTypeExtensionBase(SymbolTable symbolTable) { if(!searchedForExtensionBase) { if (null == extensionBase) { extensionBase = SchemaUtils.getComplexElementExtensionBase(getNode(), symbolTable); } searchedForExtensionBase = true; } return extensionBase; } }
if (SchemaUtils.isListWithItemType(type.getNode())) { pw.println(" cachedSerFactories.add(simplelistsf);"); pw.println(" cachedDeserFactories.add(simplelistdf);");
QName anonQName = SchemaUtils.getElementAnonQName(node); anonQName = SchemaUtils.getAttributeAnonQName(node);
SchemaUtils.getArrayComponentQName(node, numDims, underlTypeNillable, if (SchemaUtils.isSimpleTypeOrSimpleContent(node)) { te.setSimpleType(true);
!= SchemaUtils.getComplexElementRestrictionBase( type.getNode(), emitter.getSymbolTable()))) { this.canSearchParents = false;
/** * Write a common header, including the package name, the class * declaration, and the opening curly brace. * Prints javadoc from WSDL documentation. (Cannot pull up, type DOM not avail) */ protected void writeFileHeader(PrintWriter pw) throws IOException { writeHeaderComments(pw); writePackage(pw); try { String comments = SchemaUtils.getAnnotationDocumentation(type.getNode()); comments = getJavadocDescriptionPart(comments, false); if (comments != null && comments.trim().length() > 0) { pw.println(); pw.println("/**"); pw.println(comments); pw.println(" */"); } } catch (DOMException e) { // no comment } // print class declaration pw.println(getClassModifiers() + getClassText() + getClassName() + ' ' + getExtendsText() + getImplementsText() + "{"); } // writeFileHeader
boolean isSimpleList = SchemaUtils.isListWithItemType(node); SchemaUtils.getComplexElementExtensionBase(node, symbolTable); base = SchemaUtils.getComplexElementRestrictionBase( node, symbolTable); QName baseQName = SchemaUtils.getSimpleTypeBase(node);
TypeEntry base = SchemaUtils.getBaseType(te, symbolTable); if (base == null) break; &&SchemaUtils.getComplexElementExtensionBase(te.getNode(), symbolTable) == null && te.getContainedAttributes() == null) { if(!SchemaUtils.isSimpleTypeWithUnion(te.getNode())) { if (base.isSimpleType()) { QName itemType = SchemaUtils.getListItemType(tEntry.getNode()); if (itemType != null) {
Vector v = SchemaUtils.getContainedElementDeclarations(node, symbolTable); v = SchemaUtils.getContainedAttributeTypes(node, symbolTable); TypeEntry extendType = SchemaUtils.getComplexElementExtensionBase(node, symbolTable);
if (isXSDNode(node, "element")) { NodeList children = node.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { if (isXSDNode(children.item(j), "simpleType")) { node = children.item(j); break; if (isXSDNode(node, "simpleType")) { NodeList children = node.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { if (isXSDNode(children.item(j), "list")) { Node listNode = children.item(j); org.w3c.dom.Element listElement = children = listNode.getChildNodes(); for (j = 0; j < children.getLength() && localType == null; j++) { if (isXSDNode(children.item(j), "simpleType")) { localType = children.item(j); return getSimpleTypeBase(localType);
if (SchemaUtils.isMixed(parent.getNode())) { parentIsMixed = true; SchemaUtils.getComplexElementExtensionBase(parent.getNode(), emitter.getSymbolTable()); if (enableMemberFields && SchemaUtils.isMixed(type.getNode())) { isMixed = true; if (!isAny && !parentIsAny && !parentIsMixed) {
/** * Get a TypeEntry for the base type of this type, if one exists. * * @param symbolTable a <code>SymbolTable</code> value * @return a <code>TypeEntry</code> value */ public TypeEntry getComplexTypeExtensionBase(SymbolTable symbolTable) { if(!searchedForExtensionBase) { if (null == extensionBase) { extensionBase = SchemaUtils.getComplexElementExtensionBase(getNode(), symbolTable); } searchedForExtensionBase = true; } return extensionBase; } }