package org.springframework.samples.imagedb;

/**
 * Simple data holder for image descriptions.
 * @author Juergen Hoeller
 * @since 07.01.2004
 */
public class ImageDescriptor {

	private final String name;

	private final String description;

	protected ImageDescriptor(String name, String description) {
		this.name = name;
		this.description = description;
	}

	public String getName() {
		return name;
	}

	public String getDescription() {
		return description;
	}

	public String getShortDescription() {
		return (description.length() <= 200) ? description : description.substring(0, 200);
	}

	public int getDescriptionLength() {
		return description.length();
	}

}

@@ -173,16 +173,79 @@
 ptor %7B%0A%0A
+%09public static final int SHORT_DESCRIPTION_MAX_LENGTH = 1000;%0A%0A
 %09private
@@ -591,27 +591,81 @@
 tion
-.length() %3C= 200) ?
+ == null %7C%7C description.length() %3C= SHORT_DESCRIPTION_MAX_LENGTH) ?%0A%09%09   
  des
@@ -700,19 +700,44 @@
 ring(0, 
-200
+SHORT_DESCRIPTION_MAX_LENGTH
 );%0A%09%7D%0A%0A%09
@@ -772,32 +772,55 @@
 gth() %7B%0A%09%09return
+ (description != null ?
  description.len
@@ -824,16 +824,21 @@
 length()
+ : 0)
 ;%0A%09%7D%0A%0A%7D%0A

check for description == null, short description max size = 1000