JavaTypeWriterpublic class JavaTypeWriter extends Object implements org.apache.axis.wsdl.gen.GeneratorThis is Wsdl2java's Type Writer. It writes the following files, as appropriate:
.java, Holder.java. |
Fields Summary |
---|
public static final String | HOLDER_IS_NEEDEDField HOLDER_IS_NEEDED | private org.apache.axis.wsdl.gen.Generator | typeWriterField typeWriter | private org.apache.axis.wsdl.gen.Generator | holderWriterField holderWriter |
Constructors Summary |
---|
public JavaTypeWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.TypeEntry type, org.apache.axis.wsdl.symbolTable.SymbolTable symbolTable)Constructor.
if (type.isReferenced() && !type.isOnlyLiteralReferenced()) {
// Determine what sort of type this is and instantiate
// the appropriate Writer.
Node node = type.getNode();
boolean isSimpleList = SchemaUtils.isListWithItemType(node);
// If it's an array, don't emit a class
if (!type.getName().endsWith("[]") && !isSimpleList) {
// Generate the proper class for either "complex" or "enumeration" types
Vector v = Utils.getEnumerationBaseAndValues(node, symbolTable);
if (v != null) {
typeWriter = getEnumTypeWriter(emitter, type, v);
} else {
TypeEntry base =
SchemaUtils.getComplexElementExtensionBase(node,
symbolTable);
if (base == null) {
base = SchemaUtils.getComplexElementRestrictionBase(
node, symbolTable);
}
if (base == null) {
QName baseQName = SchemaUtils.getSimpleTypeBase(node);
if (baseQName != null) {
base = symbolTable.getType(baseQName);
}
}
typeWriter = getBeanWriter(emitter, type, base);
}
}
// If the holder is needed (ie., something uses this type as an out or inout
// parameter), instantiate the holder writer.
if (holderIsNeeded(type)) {
holderWriter = getHolderWriter(emitter, type);
}
if (typeWriter != null && type instanceof Type) {
((Type)type).setGenerated(true);
}
}
|
Methods Summary |
---|
public void | generate()Write all the service bindnigs: service and testcase.
if (typeWriter != null) {
typeWriter.generate();
}
if (holderWriter != null) {
holderWriter.generate();
}
| protected JavaWriter | getBeanHelperWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.TypeEntry type, java.util.Vector elements, org.apache.axis.wsdl.symbolTable.TypeEntry base, java.util.Vector attributes, boolean forException)getHelperWriter
return new JavaBeanHelperWriter(
emitter, type, elements, base, attributes,
forException ? JavaBeanFaultWriter.RESERVED_PROPERTY_NAMES
: Collections.EMPTY_SET);
| protected JavaWriter | getBeanWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.TypeEntry type, org.apache.axis.wsdl.symbolTable.TypeEntry base)getBeanWriter // CONTAINED_ELEM_AND_ATTR
Vector elements = type.getContainedElements();
Vector attributes = type.getContainedAttributes();
// If this complexType is referenced in a
// fault context, emit a bean-like exception
// class
Boolean isComplexFault = (Boolean) type.getDynamicVar(
JavaGeneratorFactory.COMPLEX_TYPE_FAULT);
if ((isComplexFault != null) && isComplexFault.booleanValue()) {
return new JavaBeanFaultWriter(emitter, type, elements, base,
attributes,
getBeanHelperWriter(emitter, type, elements, base,
attributes, true));
}
return new JavaBeanWriter(emitter, type, elements, base, attributes,
getBeanHelperWriter(emitter, type, elements, base,
attributes, false));
| protected JavaWriter | getEnumTypeWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.TypeEntry type, java.util.Vector v)getEnumWriter
return new JavaEnumTypeWriter(emitter, type, v);
| protected org.apache.axis.wsdl.gen.Generator | getHolderWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.TypeEntry type)getHolderWriter
return new JavaHolderWriter(emitter, type);
| private boolean | holderIsNeeded(org.apache.axis.wsdl.symbolTable.SymTabEntry entry)Does anything use this type as an inout/out parameter? Query the Type dynamicVar
Boolean holderIsNeeded =
(Boolean) entry.getDynamicVar(HOLDER_IS_NEEDED);
return ((holderIsNeeded != null) && holderIsNeeded.booleanValue());
|
|