Add support for multiline text fields.

This commit is contained in:
Michael Jumper
2013-10-30 23:43:30 -07:00
parent afb8474c28
commit a920199ab7
6 changed files with 75 additions and 6 deletions

View File

@@ -58,7 +58,13 @@ public class ProtocolParameter {
* An enumerated parameter, whose legal values are fully enumerated
* by a provided, finite list.
*/
ENUM
ENUM,
/**
* A text parameter that can span more than one line.
*/
MULTILINE
}
/**

View File

@@ -166,6 +166,11 @@ public class List extends AuthenticatingHttpServlet {
xml.writeAttribute("type", "enum");
break;
// Multiline parameter
case MULTILINE:
xml.writeAttribute("type", "multiline");
break;
// If unknown, fail explicitly
default:
throw new UnsupportedOperationException(

View File

@@ -61,6 +61,10 @@ public class ParamTagHandler implements TagHandler {
else if ("enum".equals(type))
protocolParameter.setType(ProtocolParameter.Type.ENUM);
// Multiline field
else if ("multiline".equals(type))
protocolParameter.setType(ProtocolParameter.Type.MULTILINE);
// Boolean field
else if ("boolean".equals(type)) {
protocolParameter.setType(ProtocolParameter.Type.BOOLEAN);