Skip to content

Commit bae82db

Browse files
Fix javadoc warnings (#124)
1 parent fc03b31 commit bae82db

20 files changed

+237
-1
lines changed

src/main/java/io/wcm/handler/media/Asset.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,21 @@
3838
public interface Asset extends Adaptable {
3939

4040
/**
41+
* Get title of media item.
4142
* @return Title of media item
4243
*/
4344
@Nullable
4445
String getTitle();
4546

4647
/**
48+
* Get alternative text for media item.
4749
* @return Alternative text for media item
4850
*/
4951
@Nullable
5052
String getAltText();
5153

5254
/**
55+
* Get description for this media item.
5356
* @return Description for this media item
5457
*/
5558
@Nullable
@@ -63,6 +66,7 @@ public interface Asset extends Adaptable {
6366
String getPath();
6467

6568
/**
69+
* Get properties of media item.
6670
* @return Properties of media item
6771
*/
6872
@NotNull

src/main/java/io/wcm/handler/media/CropDimension.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public final class CropDimension extends Dimension {
4242
private final boolean autoCrop;
4343

4444
/**
45+
* Create crop dimension.
4546
* @param left Left in pixels
4647
* @param top Top in pixels
4748
* @param width Width in pixels
@@ -52,6 +53,7 @@ public CropDimension(long left, long top, long width, long height) {
5253
}
5354

5455
/**
56+
* Create crop dimension with auto-crop flag.
5557
* @param left Left in pixels
5658
* @param top Top in pixels
5759
* @param width Width in pixels
@@ -66,34 +68,39 @@ public CropDimension(long left, long top, long width, long height, boolean autoC
6668
}
6769

6870
/**
71+
* Get left coordinate in pixels.
6972
* @return Left in pixels
7073
*/
7174
public long getLeft() {
7275
return this.left;
7376
}
7477

7578
/**
79+
* Get top coordinate in pixels.
7680
* @return Top in pixels
7781
*/
7882
public long getTop() {
7983
return this.top;
8084
}
8185

8286
/**
87+
* Get right coordinate in pixels.
8388
* @return Right in pixels
8489
*/
8590
public long getRight() {
8691
return getLeft() + getWidth();
8792
}
8893

8994
/**
95+
* Get bottom coordinate in pixels.
9096
* @return Bottom in pixels
9197
*/
9298
public long getBottom() {
9399
return getTop() + getHeight();
94100
}
95101

96102
/**
103+
* Check if dimension is marked as auto-cropped.
97104
* @return true if is dimenions is marked as auto-cropped
98105
*/
99106
public boolean isAutoCrop() {
@@ -121,20 +128,23 @@ public String toString() {
121128
}
122129

123130
/**
131+
* Get crop string with coordinates.
124132
* @return Crop string with left,top,right,bottom.
125133
*/
126134
public @NotNull String getCropString() {
127135
return getLeft() + "," + getTop() + "," + getRight() + "," + getBottom();
128136
}
129137

130138
/**
139+
* Get crop string with dimensions.
131140
* @return Crop string with left,top,width,height.
132141
*/
133142
public @NotNull String getCropStringWidthHeight() {
134143
return getLeft() + "," + getTop() + "," + getWidth() + "," + getHeight();
135144
}
136145

137146
/**
147+
* Get rectangle representation of crop dimension.
138148
* @return Rectangle
139149
*/
140150
public @NotNull Rectangle2D getRectangle() {

src/main/java/io/wcm/handler/media/Dimension.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class Dimension {
3636
private final long height;
3737

3838
/**
39+
* Create dimension with width and height.
3940
* @param width Width in pixels
4041
* @param height Height in pixels
4142
*/
@@ -45,13 +46,15 @@ public Dimension(long width, long height) {
4546
}
4647

4748
/**
49+
* Get width in pixels.
4850
* @return Width in pixels
4951
*/
5052
public final long getWidth() {
5153
return this.width;
5254
}
5355

5456
/**
57+
* Get height in pixels.
5558
* @return Height in pixels
5659
*/
5760
public final long getHeight() {

src/main/java/io/wcm/handler/media/Media.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public final class Media {
6262
private String markup;
6363

6464
/**
65+
* Create a media object.
6566
* @param mediaSource Media source
6667
* @param mediaRequest Processed media request
6768
*/
@@ -71,6 +72,7 @@ public Media(@NotNull MediaSource mediaSource, @NotNull MediaRequest mediaReques
7172
}
7273

7374
/**
75+
* Get media source.
7476
* @return Media source
7577
*/
7678
@JsonIgnore
@@ -79,6 +81,7 @@ public Media(@NotNull MediaSource mediaSource, @NotNull MediaRequest mediaReques
7981
}
8082

8183
/**
84+
* Get media handling request.
8285
* @return Media handling request
8386
*/
8487
@JsonIgnore
@@ -87,13 +90,15 @@ public Media(@NotNull MediaSource mediaSource, @NotNull MediaRequest mediaReques
8790
}
8891

8992
/**
93+
* Set media handling request.
9094
* @param mediaRequest Media handling request
9195
*/
9296
public void setMediaRequest(@NotNull MediaRequest mediaRequest) {
9397
this.mediaRequest = mediaRequest;
9498
}
9599

96100
/**
101+
* Get HTML element.
97102
* @return Html element
98103
*/
99104
@JsonIgnore
@@ -106,6 +111,7 @@ public void setMediaRequest(@NotNull MediaRequest mediaRequest) {
106111
}
107112

108113
/**
114+
* Get media HTML element serialized to string.
109115
* @return Media HTML element serialized to string. Returns null if media element is null.
110116
*/
111117
@JsonIgnore
@@ -128,6 +134,7 @@ public void setMediaRequest(@NotNull MediaRequest mediaRequest) {
128134
}
129135

130136
/**
137+
* Set function that builds the HTML element representation on demand.
131138
* @param value Function that builds the HTML element representation on demand
132139
*/
133140
public void setElementBuilder(@NotNull Function<Media, HtmlElement> value) {
@@ -136,13 +143,15 @@ public void setElementBuilder(@NotNull Function<Media, HtmlElement> value) {
136143
}
137144

138145
/**
146+
* Get media URL.
139147
* @return Media URL
140148
*/
141149
public @Nullable String getUrl() {
142150
return this.url;
143151
}
144152

145153
/**
154+
* Set media URL.
146155
* @param value Media URL
147156
*/
148157
public void setUrl(@Nullable String value) {
@@ -199,6 +208,7 @@ public void setRenditions(@Nullable Collection<Rendition> renditions) {
199208
}
200209

201210
/**
211+
* Get crop dimensions.
202212
* @return Crop dimensions (optional)
203213
*/
204214
@JsonIgnore
@@ -207,13 +217,15 @@ public void setRenditions(@Nullable Collection<Rendition> renditions) {
207217
}
208218

209219
/**
220+
* Set crop dimensions.
210221
* @param cropDimension Crop dimensions (optional)
211222
*/
212223
public void setCropDimension(@Nullable CropDimension cropDimension) {
213224
this.cropDimension = cropDimension;
214225
}
215226

216227
/**
228+
* Get image rotation.
217229
* @return Image rotation (optional)
218230
*/
219231
@JsonIgnore
@@ -222,13 +234,15 @@ public void setCropDimension(@Nullable CropDimension cropDimension) {
222234
}
223235

224236
/**
237+
* Set image rotation.
225238
* @param rotation Image Rotation (optional)
226239
*/
227240
public void setRotation(@Nullable Integer rotation) {
228241
this.rotation = rotation;
229242
}
230243

231244
/**
245+
* Get image map.
232246
* @return Image map (optional)
233247
*/
234248
@JsonIgnore
@@ -237,20 +251,23 @@ public void setRotation(@Nullable Integer rotation) {
237251
}
238252

239253
/**
254+
* Set image map.
240255
* @param map Image map (optional)
241256
*/
242257
public void setMap(@Nullable List<ImageMapArea> map) {
243258
this.map = map;
244259
}
245260

246261
/**
262+
* Check if media is valid.
247263
* @return true if link is valid and was resolved successfully
248264
*/
249265
public boolean isValid() {
250266
return (mediaInvalidReason == null);
251267
}
252268

253269
/**
270+
* Get reason why the requested media could not be resolved.
254271
* @return Reason why the requested media could not be resolved and is invalid
255272
*/
256273
@JsonIgnore
@@ -259,13 +276,15 @@ public boolean isValid() {
259276
}
260277

261278
/**
279+
* Set reason why the requested media could not be resolved.
262280
* @param mediaInvalidReason Reason why the requested media could not be resolved and is invalid
263281
*/
264282
public void setMediaInvalidReason(@Nullable MediaInvalidReason mediaInvalidReason) {
265283
this.mediaInvalidReason = mediaInvalidReason;
266284
}
267285

268286
/**
287+
* Get custom message when media invalid reason is CUSTOM.
269288
* @return Custom message when {@link #getMediaInvalidReason()} is set to {@link MediaInvalidReason#CUSTOM}.
270289
* Message is interpreted as i18n key.
271290
*/
@@ -274,6 +293,7 @@ public void setMediaInvalidReason(@Nullable MediaInvalidReason mediaInvalidReaso
274293
}
275294

276295
/**
296+
* Set custom message when media invalid reason is CUSTOM.
277297
* @param mediaInvalidReasonCustomMessage Custom message when {@link #getMediaInvalidReason()} is set to
278298
* {@link MediaInvalidReason#CUSTOM}. Message is interpreted as i18n key.
279299
*/

0 commit comments

Comments
 (0)