/** * Returns the class name that should be used to serialize and * deserialize this binary element */ protected String getBinaryTypeEncoderName(String elementName) { TypeEntry type = getElementDecl(elementName); if (type != null) { String typeName = type.getQName().getLocalPart(); if (typeName.equals("base64Binary")) return "org.apache.axis.encoding.Base64"; if (typeName.equals("hexBinary")) return "org.apache.axis.types.HexBinary"; throw new java.lang.RuntimeException("Unknown binary type " + typeName + " for element " + elementName); } throw new java.lang.RuntimeException("Unknown element " + elementName); }
/** * Returns the class name that should be used to serialize and * deserialize this binary element */ protected String getBinaryTypeEncoderName(String elementName) { TypeEntry type = getElementDecl(elementName); if (type != null) { String typeName = type.getQName().getLocalPart(); if (typeName.equals("base64Binary")) return "org.apache.axis.encoding.Base64"; if (typeName.equals("hexBinary")) return "org.apache.axis.types.HexBinary"; throw new java.lang.RuntimeException("Unknown binary type " + typeName + " for element " + elementName); } throw new java.lang.RuntimeException("Unknown element " + elementName); }
/** * Returns the class name that should be used to serialize and * deserialize this binary element */ protected String getBinaryTypeEncoderName(String elementName) { TypeEntry type = getElementDecl(elementName); if (type != null) { String typeName = type.getQName().getLocalPart(); if (typeName.equals("base64Binary")) return "org.apache.axis.encoding.Base64"; if (typeName.equals("hexBinary")) return "org.apache.axis.types.HexBinary"; throw new java.lang.RuntimeException("Unknown binary type " + typeName + " for element " + elementName); } throw new java.lang.RuntimeException("Unknown element " + elementName); }
/** * 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
private ArrayTypeDescriptor constructMapType(TypeEntry type) { ArrayTypeDescriptor result = new ArrayTypeDescriptor(); // Method getItemQName() not supported in axis 1.2 used by globus, so replaced with the line below //TypeEntry mapItem = getSymbolTable().getType(type.getItemQName()); TypeEntry mapItem = getSymbolTable().getType(type.getQName()); if (mapItem == null) { mapItem = getSymbolTable().getType( new QName(type.getQName().getNamespaceURI(), "mapItem")); } result.setElementType(constructType(mapItem)); result.setQname(type.getQName()); result.setType(type.getQName().getLocalPart()); return result; }
private ArrayTypeDescriptor constructArrayType(TypeEntry type) { ArrayTypeDescriptor result = new ArrayTypeDescriptor(); result.setElementType(constructType(type.getRefType())); result.setType(type.getQName().getLocalPart()); result.setQname(type.getQName()); // Method getItemQName() not supported in axis 1.2 used by globus //result.setWrapped(type.getItemQName()!=null); return result; }
/** * Method getGenerator * * @param type * @param symbolTable * @return */ public Generator getGenerator(TypeEntry type, SymbolTable symbolTable) { if (include(type.getQName())) { Generator writer = new JavaTypeWriter(emitter, type, symbolTable); typeWriters.addStuff(writer, type, symbolTable); return typeWriters; } else { return new NoopGenerator(); } } // getGenerator
private BaseTypeDescriptor constructBaseType(DefinedElement type) { BaseTypeDescriptor result = null; if (type.getRefType() == null) { result = constructBaseType((TypeEntry) type); } else { result = new BaseTypeDescriptor(); result.setType(type.getRefType().getQName().getLocalPart()); result.setQname(type.getQName()); } return result; }
/** * Method getGenerator * * @param type * @param symbolTable * @return */ public Generator getGenerator(TypeEntry type, SymbolTable symbolTable) { if (include(type.getQName())) { Generator writer = new JavaTypeWriter(emitter, type, symbolTable); typeWriters.addStuff(writer, type, symbolTable); return typeWriters; } else { return new NoopGenerator(); } } // getGenerator
/** * Method getGenerator * * @param type * @param symbolTable * @return */ public Generator getGenerator(TypeEntry type, SymbolTable symbolTable) { if (include(type.getQName())) { Generator writer = new JavaTypeWriter(emitter, type, symbolTable); typeWriters.addStuff(writer, type, symbolTable); return typeWriters; } else { return new NoopGenerator(); } } // getGenerator
/** * Get the XML type (QName) for a Fault - look in the (single) fault * part for type="" or element="" - if type, return the QName. If * element, return the reference type for the element. * * @param part the Fault to dig into * @param st the SymbolTable we're using * @return the XML type of the Fault's part, or null */ private QName getFaultType(SymbolTable st, Part part) { if (part != null) { if (part.getTypeName() != null) { return part.getTypeName(); } // Literal, so get the element's type TypeEntry entry = st.getElement(part.getElementName()); if ((entry != null) && (entry.getRefType() != null)) { return entry.getRefType().getQName(); } } return null; } }
/** * Get the XML type (QName) for a Fault - look in the (single) fault * part for type="" or element="" - if type, return the QName. If * element, return the reference type for the element. * * @param part the Fault to dig into * @param st the SymbolTable we're using * @return the XML type of the Fault's part, or null */ private QName getFaultType(SymbolTable st, Part part) { if (part != null) { if (part.getTypeName() != null) { return part.getTypeName(); } // Literal, so get the element's type TypeEntry entry = st.getElement(part.getElementName()); if ((entry != null) && (entry.getRefType() != null)) { return entry.getRefType().getQName(); } } return null; } }
/** * Get the XML type (QName) for a Fault - look in the (single) fault * part for type="" or element="" - if type, return the QName. If * element, return the reference type for the element. * * @param part the Fault to dig into * @param st the SymbolTable we're using * @return the XML type of the Fault's part, or null */ private QName getFaultType(SymbolTable st, Part part) { if (part != null) { if (part.getTypeName() != null) { return part.getTypeName(); } // Literal, so get the element's type TypeEntry entry = st.getElement(part.getElementName()); if ((entry != null) && (entry.getRefType() != null)) { return entry.getRefType().getQName(); } } return null; } }