1
1
/*
2
- * Copyright 2006 the original author or authors.
2
+ * Copyright 2006-2007 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
27
27
import org .springframework .xml .sax .SaxUtils ;
28
28
29
29
/**
30
- * Default implementation of the <code>Wsdl11Definition</code> interface. Allows a WSDL to be set by the
31
- * <code>wsdl</code> property.
30
+ * The default {@link Wsdl11Definition} implementation.
31
+ *
32
+ * <p>Allows a WSDL to be set by the {@link #setWsdl wsdl} property, or directly
33
+ * in the {@link #SimpleWsdl11Definition(org.springframework.core.io.Resource) constructor}.
32
34
*
33
35
* @author Arjen Poutsma
34
- * @see #setWsdl(org.springframework.core.io.Resource)
35
36
*/
36
37
public class SimpleWsdl11Definition implements Wsdl11Definition , InitializingBean {
37
38
38
39
private Resource wsdlResource ;
39
40
41
+
40
42
/**
41
- * Constructs a new <code>SimpleWsdl11Definition</code>. Calling <code>setWsdl </code> is required .
42
- *
43
- * @see #setWsdl(org.springframework.core.io.Resource)
43
+ * Create a new instance of the <code>SimpleWsdl11Definition </code> class .
44
+ * <p>A subsequent call to the {@link #setWsdl(org.springframework.core.io.Resource)}
45
+ * method is required.
44
46
*/
45
47
public SimpleWsdl11Definition () {
46
48
}
47
49
48
- /** Constructs a new <code>SimpleWsdl11Definition</code> with the given resource. */
50
+ /**
51
+ * Create a new instance of the <code>SimpleWsdl11Definition</code> class.
52
+ * @param wsdlResource the WSDL resource; must not be <code>null</code>
53
+ * @throws IllegalArgumentException if the supplied <code>wsdlResource</code> is <code>null</code>
54
+ */
49
55
public SimpleWsdl11Definition (Resource wsdlResource ) {
50
56
Assert .notNull (wsdlResource , "wsdlResource must not be null" );
51
57
this .wsdlResource = wsdlResource ;
52
58
}
53
59
60
+
54
61
public void afterPropertiesSet () throws Exception {
55
- Assert .notNull (wsdlResource , "wsdl is required" );
56
- Assert .isTrue (wsdlResource .exists (), "wsdl \" " + wsdlResource + "\" does not exit" );
62
+ Assert .notNull (this . wsdlResource , "wsdl is required" );
63
+ Assert .isTrue (this . wsdlResource .exists (), "wsdl '" + this . wsdlResource + "' does not exit" );
57
64
}
58
65
66
+
59
67
public Source getSource () {
60
68
try {
61
- return new SAXSource (SaxUtils .createInputSource (wsdlResource ));
69
+ return new SAXSource (SaxUtils .createInputSource (this . wsdlResource ));
62
70
}
63
71
catch (IOException ex ) {
64
- throw new WsdlDefinitionException ("Could not create source from " + wsdlResource , ex );
72
+ throw new WsdlDefinitionException ("Could not create source from " + this . wsdlResource , ex );
65
73
}
66
74
}
67
75
76
+
77
+ /**
78
+ * Set the WSDL resource to be exposed by calls to this instances'
79
+ * {@link #getSource()} method.
80
+ * @param wsdlResource the WSDL resource
81
+ */
68
82
public void setWsdl (Resource wsdlResource ) {
69
83
this .wsdlResource = wsdlResource ;
70
84
}
85
+
71
86
}
0 commit comments