/** * Constructor. * * @param emitter * @param type * @param elements */ protected JavaEnumTypeWriter(Emitter emitter, TypeEntry type, Vector elements) { super(emitter, type.getName(), "enumType"); this.elements = elements; this.type = type; } // ctor
/** * Constructor. * * @param emitter * @param type * @param elements */ protected JavaEnumTypeWriter(Emitter emitter, TypeEntry type, Vector elements) { super(emitter, type.getName(), "enumType"); this.elements = elements; this.type = type; } // ctor
/** * Constructor. * * @param emitter * @param type * @param elements */ protected JavaEnumTypeWriter(Emitter emitter, TypeEntry type, Vector elements) { super(emitter, type.getName(), "enumType"); this.elements = elements; this.type = type; } // ctor
/** * Method isPrimitiveType * * @param type * @return */ public static boolean isPrimitiveType(TypeEntry type) { return TYPES.get(type.getName()) != null; } // isPrimitiveType
/** * Method isPrimitiveType * * @param type * @return */ public static boolean isPrimitiveType(TypeEntry type) { return TYPES.get(type.getName()) != null; } // isPrimitiveType
/** * Method isPrimitiveType * * @param type * @return */ public static boolean isPrimitiveType(TypeEntry type) { return TYPES.get(type.getName()) != null; } // isPrimitiveType
/** * Return a string with "var" wrapped as an Object type if needed * * @param type * @param var * @return */ public static String wrapPrimitiveType(TypeEntry type, String var) { String objType = (type == null) ? null : (String) TYPES.get(type.getName()); if (objType != null) { return "new " + objType + "(" + var + ")"; } else if ((type != null) && type.getName().equals("byte[]") && type.getQName().getLocalPart().equals("hexBinary")) { // Need to wrap byte[] in special HexBinary object to get the correct serialization return "new org.apache.axis.types.HexBinary(" + var + ")"; } else { return var; } } // wrapPrimitiveType
/** * Return a string with "var" wrapped as an Object type if needed * * @param type * @param var * @return */ public static String wrapPrimitiveType(TypeEntry type, String var) { String objType = (type == null) ? null : (String) TYPES.get(type.getName()); if (objType != null) { return "new " + objType + "(" + var + ")"; } else if ((type != null) && type.getName().equals("byte[]") && type.getQName().getLocalPart().equals("hexBinary")) { // Need to wrap byte[] in special HexBinary object to get the correct serialization return "new org.apache.axis.types.HexBinary(" + var + ")"; } else { return var; } } // wrapPrimitiveType
/** * Return a string with "var" wrapped as an Object type if needed * * @param type * @param var * @return */ public static String wrapPrimitiveType(TypeEntry type, String var) { String objType = (type == null) ? null : (String) TYPES.get(type.getName()); if (objType != null) { return "new " + objType + "(" + var + ")"; } else if ((type != null) && type.getName().equals("byte[]") && type.getQName().getLocalPart().equals("hexBinary")) { // Need to wrap byte[] in special HexBinary object to get the correct serialization return "new org.apache.axis.types.HexBinary(" + var + ")"; } else { return var; } } // wrapPrimitiveType
/** * Generate the holder for the given complex type. * * @param pw * @throws IOException */ protected void writeFileBody(PrintWriter pw) throws IOException { String holderType = type.getName(); if ((type instanceof CollectionType && ((CollectionType) type).isWrapped()) || type.getUnderlTypeNillable()) { /* * For soapenc arrays or elements with maxOccurs="unbounded" * having a primitive type and nillable="true" the holderType * should be the corresponding wrapped type. */ holderType = Utils.getWrapperType(type); } pw.println(" public " + holderType + " value;"); pw.println(); pw.println(" public " + className + "() {"); pw.println(" }"); pw.println(); pw.println(" public " + className + "(" + holderType + " value) {"); pw.println(" this.value = value;"); pw.println(" }"); pw.println(); } // writeOperation
/** * Generate the holder for the given complex type. * * @param pw * @throws IOException */ protected void writeFileBody(PrintWriter pw) throws IOException { String holderType = type.getName(); if ((type instanceof CollectionType && ((CollectionType) type).isWrapped()) || type.getUnderlTypeNillable()) { /* * For soapenc arrays or elements with maxOccurs="unbounded" * having a primitive type and nillable="true" the holderType * should be the corresponding wrapped type. */ holderType = Utils.getWrapperType(type); } pw.println(" public " + holderType + " value;"); pw.println(); pw.println(" public " + className + "() {"); pw.println(" }"); pw.println(); pw.println(" public " + className + "(" + holderType + " value) {"); pw.println(" this.value = value;"); pw.println(" }"); pw.println(); } // writeOperation
/** * Generate the holder for the given complex type. * * @param pw * @throws IOException */ protected void writeFileBody(PrintWriter pw) throws IOException { String holderType = type.getName(); if ((type instanceof CollectionType && ((CollectionType) type).isWrapped()) || type.getUnderlTypeNillable()) { /* * For soapenc arrays or elements with maxOccurs="unbounded" * having a primitive type and nillable="true" the holderType * should be the corresponding wrapped type. */ holderType = Utils.getWrapperType(type); } pw.println(" public " + holderType + " value;"); pw.println(); pw.println(" public " + className + "() {"); pw.println(" }"); pw.println(); pw.println(" public " + className + "(" + holderType + " value) {"); pw.println(" this.value = value;"); pw.println(" }"); pw.println(); } // writeOperation
/** * Returns the appropriate extends text * * @return "" or " extends <class> " */ protected String getExtendsText() { // See if this class extends another class String extendsText = ""; if ((extendType != null) && !isUnion() && (!type.isSimpleType() || !extendType.isBaseType()) && (extendType.getDimensions().length() == 0)) { extendsText = " extends " + extendType.getName() + " "; } return extendsText; }
/** * Returns the appropriate extends text * * @return "" or " extends <class> " */ protected String getExtendsText() { // See if this class extends another class String extendsText = ""; if ((extendType != null) && !isUnion() && (!type.isSimpleType() || !extendType.isBaseType()) && (extendType.getDimensions().length() == 0)) { extendsText = " extends " + extendType.getName() + " "; } return extendsText; }
/** * Returns the appropriate extends text * * @return "" or " extends <class> " */ protected String getExtendsText() { // See if this class extends another class String extendsText = ""; if ((extendType != null) && !isUnion() && (!type.isSimpleType() || !extendType.isBaseType()) && (extendType.getDimensions().length() == 0)) { extendsText = " extends " + extendType.getName() + " "; } return extendsText; }
/** * Returns a "wrapper" type for the given TypeEntry. * * @param type * @return the name of a java wrapper class for the type, or the type's * name if it's not a primitive. */ public static String getWrapperType(TypeEntry type) { String dims = type.getDimensions(); if (!dims.equals("")) { TypeEntry te = type.getRefType(); if (te != null && !te.getDimensions().equals("")) { return getWrapperType(te) + dims; } if (te instanceof BaseType || te instanceof DefinedElement && te.getRefType() instanceof BaseType) { return getWrapperType(te) + dims; } } return getWrapperType(type.getName()); }
/** * Returns a "wrapper" type for the given TypeEntry. * * @param type * @return the name of a java wrapper class for the type, or the type's * name if it's not a primitive. */ public static String getWrapperType(TypeEntry type) { String dims = type.getDimensions(); if (!dims.equals("")) { TypeEntry te = type.getRefType(); if (te != null && !te.getDimensions().equals("")) { return getWrapperType(te) + dims; } if (te instanceof BaseType || te instanceof DefinedElement && te.getRefType() instanceof BaseType) { return getWrapperType(te) + dims; } } return getWrapperType(type.getName()); }
/** * Returns a "wrapper" type for the given TypeEntry. * * @param type * @return the name of a java wrapper class for the type, or the type's * name if it's not a primitive. */ public static String getWrapperType(TypeEntry type) { String dims = type.getDimensions(); if (!dims.equals("")) { TypeEntry te = type.getRefType(); if (te != null && !te.getDimensions().equals("")) { return getWrapperType(te) + dims; } if (te instanceof BaseType || te instanceof DefinedElement && te.getRefType() instanceof BaseType) { return getWrapperType(te) + dims; } } return getWrapperType(type.getName()); }