001: /*
002: * WSDL2Java.java
003: *
004: * Created on October 30, 2006, 10:33 AM
005: *
006: * To change this template, choose Tools | Template Manager
007: * and open the template in the editor.
008: */
009:
010: package org.netbeans.modules.e2e.api.wsdl.wsdl2java;
011:
012: import java.util.List;
013:
014: /**
015: *
016: * @author Michal Skvor
017: */
018: public interface WSDL2Java {
019:
020: /**
021: * Processes wsdl and writes output files
022: */
023: public boolean generate();
024:
025: /**
026: * Returns validation result from validation
027: */
028: public List<ValidationResult> validate();
029:
030: /**
031: * Configuration for the WSDL2Java
032: */
033: public static class Configuration {
034:
035: public static final short TYPE_JAVA_BEANS = 1;
036: public static final short TYPE_STRUCTURES = 2;
037:
038: private String wsdlFileName;
039: private String outputDirectory;
040: private boolean overwriteExisting;
041: private String packageName;
042: private short generateType;
043:
044: private boolean generateDataBinding;
045:
046: public Configuration() {
047: generateType = TYPE_JAVA_BEANS;
048:
049: packageName = "";
050: overwriteExisting = true;
051: generateDataBinding = false;
052: }
053:
054: /**
055: * Sets the wsdl file
056: *
057: * @param file path to file
058: */
059:
060: public void setWSDLFileName(String file) {
061: this .wsdlFileName = file;
062: }
063:
064: public String getWSDLFileName() {
065: return wsdlFileName;
066: }
067:
068: public void setOutputDirectory(String directoryName) {
069: this .outputDirectory = directoryName;
070: }
071:
072: public String getOutputDirectory() {
073: return outputDirectory;
074: }
075:
076: public void setOverwriteExistingFiles(boolean overwrite) {
077: this .overwriteExisting = overwrite;
078: }
079:
080: public boolean getOverwriteExistingFiles() {
081: return overwriteExisting;
082: }
083:
084: public void setPackageName(String packageName) {
085: this .packageName = packageName;
086: }
087:
088: public String getPackageName() {
089: return packageName;
090: }
091:
092: public void setGenerateType(short type) {
093: this .generateType = type;
094: }
095:
096: public short getGenerateType() {
097: return generateType;
098: }
099:
100: public void setGenerateDataBinding(boolean value) {
101: this .generateDataBinding = value;
102: }
103:
104: public boolean getGenerateDataBinding() {
105: return generateDataBinding;
106: }
107: }
108:
109: /**
110: * Result of the validation
111: */
112: public static final class ValidationResult {
113:
114: public enum ErrorLevel {
115: FATAL, WARNING, NOTIFY
116: };
117:
118: private ErrorLevel errorLevel;
119: private String message;
120:
121: public ValidationResult(ErrorLevel errorLevel, String message) {
122: this .errorLevel = errorLevel;
123: this .message = message;
124: }
125:
126: public ErrorLevel getErrorLevel() {
127: return errorLevel;
128: }
129:
130: public String getMessage() {
131: return message;
132: }
133: }
134: }
|