Skip to content

Commit 70d4e33

Browse files
author
Rick Evans
committed
Polishing while addressing [SWS-132].
1 parent 4b00b64 commit 70d4e33

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006 the original author or authors.
2+
* Copyright 2006-2007 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,45 +27,60 @@
2727
import org.springframework.xml.sax.SaxUtils;
2828

2929
/**
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}.
3234
*
3335
* @author Arjen Poutsma
34-
* @see #setWsdl(org.springframework.core.io.Resource)
3536
*/
3637
public class SimpleWsdl11Definition implements Wsdl11Definition, InitializingBean {
3738

3839
private Resource wsdlResource;
3940

41+
4042
/**
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.
4446
*/
4547
public SimpleWsdl11Definition() {
4648
}
4749

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+
*/
4955
public SimpleWsdl11Definition(Resource wsdlResource) {
5056
Assert.notNull(wsdlResource, "wsdlResource must not be null");
5157
this.wsdlResource = wsdlResource;
5258
}
5359

60+
5461
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");
5764
}
5865

66+
5967
public Source getSource() {
6068
try {
61-
return new SAXSource(SaxUtils.createInputSource(wsdlResource));
69+
return new SAXSource(SaxUtils.createInputSource(this.wsdlResource));
6270
}
6371
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);
6573
}
6674
}
6775

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+
*/
6882
public void setWsdl(Resource wsdlResource) {
6983
this.wsdlResource = wsdlResource;
7084
}
85+
7186
}

0 commit comments

Comments
 (0)