/** * Get string representation with indentation * * @param indent * @return */ protected String toString(String indent) { String refString = indent + "RefType: null \n"; if (refType != null) { refString = indent + "RefType:\n" + refType.toString(indent + " ") + "\n"; } return super.toString(indent) + indent + "Class: " + this.getClass().getName() + "\n" + indent + "Base?: " + isBaseType + "\n" + indent + "Undefined?: " + undefined + "\n" + indent + "isSimpleType? " + isSimpleType + "\n" + indent + "Node: " + getNode() + "\n" + indent + "Dims: " + dims + "\n" + indent + "isOnlyLiteralReferenced: " + onlyLiteralReference + "\n" + refString; }
/** * Get string representation with indentation * * @param indent * @return */ protected String toString(String indent) { String refString = indent + "RefType: null \n"; if (refType != null) { refString = indent + "RefType:\n" + refType.toString(indent + " ") + "\n"; } return super.toString(indent) + indent + "Class: " + this.getClass().getName() + "\n" + indent + "Base?: " + isBaseType + "\n" + indent + "Undefined?: " + undefined + "\n" + indent + "isSimpleType? " + isSimpleType + "\n" + indent + "Node: " + getNode() + "\n" + indent + "Dims: " + dims + "\n" + indent + "isOnlyLiteralReferenced: " + onlyLiteralReference + "\n" + refString; }
/** * Get string representation with indentation * * @param indent * @return */ protected String toString(String indent) { String refString = indent + "RefType: null \n"; if (refType != null) { refString = indent + "RefType:\n" + refType.toString(indent + " ") + "\n"; } return super.toString(indent) + indent + "Class: " + this.getClass().getName() + "\n" + indent + "Base?: " + isBaseType + "\n" + indent + "Undefined?: " + undefined + "\n" + indent + "isSimpleType? " + isSimpleType + "\n" + indent + "Node: " + getNode() + "\n" + indent + "Dims: " + dims + "\n" + indent + "isOnlyLiteralReferenced: " + onlyLiteralReference + "\n" + refString; }
public static boolean shouldEmit(TypeEntry type) { // 1) Don't register types that are base (primitive) types // or attributeGroups or xs:groups. // If the baseType != null && getRefType() != null this // is a simpleType that must be registered. // 2) Don't register the special types for collections // (indexed properties) or elements // 3) Don't register types that are not referenced // or only referenced in a literal context. return (!(((type.getBaseType() != null) && (type.getRefType() == null)) || (type instanceof CollectionTE) || (type instanceof Element) || !type.isReferenced() || type.isOnlyLiteralReferenced() || ((type.getNode() != null) && (isXsNode(type.getNode(), "group") || isXsNode(type.getNode(), "attributeGroup"))))); }
public static boolean shouldEmit(TypeEntry type) { // 1) Don't register types that are base (primitive) types // or attributeGroups or xs:groups. // If the baseType != null && getRefType() != null this // is a simpleType that must be registered. // 2) Don't register the special types for collections // (indexed properties) or elements // 3) Don't register types that are not referenced // or only referenced in a literal context. return (!(((type.getBaseType() != null) && (type.getRefType() == null)) || (type instanceof CollectionTE) || (type instanceof Element) || !type.isReferenced() || type.isOnlyLiteralReferenced() || ((type.getNode() != null) && (isXsNode(type.getNode(), "group") || isXsNode(type.getNode(), "attributeGroup"))))); }
public static boolean shouldEmit(TypeEntry type) { // 1) Don't register types that are base (primitive) types // or attributeGroups or xs:groups. // If the baseType != null && getRefType() != null this // is a simpleType that must be registered. // 2) Don't register the special types for collections // (indexed properties) or elements // 3) Don't register types that are not referenced // or only referenced in a literal context. return (!(((type.getBaseType() != null) && (type.getRefType() == null)) || (type instanceof CollectionTE) || (type instanceof Element) || !type.isReferenced() || type.isOnlyLiteralReferenced() || ((type.getNode() != null) && (isXsNode(type.getNode(), "group") || isXsNode(type.getNode(), "attributeGroup"))))); }
if ((type != null) && (type.getNode() != null)) { getDerivedTypes(type, types, symbolTable);
if ((type != null) && (type.getNode() != null)) { getDerivedTypes(type, types, symbolTable);
/** * 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
/** * 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
/** * 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
/** * Returns the appropriate extends text * * @return "" or "abstract " */ protected String getClassModifiers() { Node node = type.getNode(); if (node != null) { if (JavaUtils.isTrueExplicitly(Utils.getAttribute(node, "abstract"))) { return super.getClassModifiers() + "abstract "; } } return super.getClassModifiers(); } // getClassModifiers
/** * Returns the appropriate extends text * * @return "" or "abstract " */ protected String getClassModifiers() { Node node = type.getNode(); if (node != null) { if (JavaUtils.isTrueExplicitly(Utils.getAttribute(node, "abstract"))) { return super.getClassModifiers() + "abstract "; } } return super.getClassModifiers(); } // getClassModifiers
/** * Returns the appropriate extends text * * @return "" or "abstract " */ protected String getClassModifiers() { Node node = type.getNode(); if (node != null) { if (JavaUtils.isTrueExplicitly(Utils.getAttribute(node, "abstract"))) { return super.getClassModifiers() + "abstract "; } } return super.getClassModifiers(); } // getClassModifiers
&& (null != SchemaUtils.getComplexElementRestrictionBase( type.getNode(), emitter.getSymbolTable()))) { this.canSearchParents = false; } else {
&& (null != SchemaUtils.getComplexElementRestrictionBase( type.getNode(), emitter.getSymbolTable()))) { this.canSearchParents = false; } else {
/** * 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; }
/** * 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; }
/** * 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; }