Fix whitespace errors.

This commit is contained in:
Michael Jumper
2013-04-24 12:02:05 -07:00
parent 9106d60518
commit c81ffac664
12 changed files with 68 additions and 68 deletions

View File

@@ -26,7 +26,7 @@ import java.util.Collection;
* Describes a protocol and all parameters associated with it, as required by
* a protocol plugin for guacd. This class allows known parameters for a
* protocol to be exposed to the user as friendly fields.
*
*
* @author Michael Jumper
*/
public class ProtocolInfo {
@@ -46,10 +46,10 @@ public class ProtocolInfo {
*/
private Collection<ProtocolParameter> parameters =
new ArrayList<ProtocolParameter>();
/**
* Returns the human-readable title associated with this protocol.
*
*
* @return The human-readable title associated with this protocol.
*/
public String getTitle() {
@@ -58,7 +58,7 @@ public class ProtocolInfo {
/**
* Sets the human-readable title associated with this protocol.
*
*
* @param title The human-readable title to associate with this protocol.
*/
public void setTitle(String title) {
@@ -68,7 +68,7 @@ public class ProtocolInfo {
/**
* Returns the unique name of this protocol. The protocol name is the
* value required by the corresponding protocol plugin for guacd.
*
*
* @return The unique name of this protocol.
*/
public String getName() {
@@ -78,7 +78,7 @@ public class ProtocolInfo {
/**
* Sets the unique name of this protocol. The protocol name is the value
* required by the corresponding protocol plugin for guacd.
*
*
* @param name The unique name of this protocol.
*/
public void setName(String name) {
@@ -89,7 +89,7 @@ public class ProtocolInfo {
* Returns a mutable collection of the protocol parameters associated with
* this protocol. Changes to this collection affect the parameters exposed
* to the user.
*
*
* @return A mutable collection of protocol parameters.
*/
public Collection<ProtocolParameter> getParameters() {

View File

@@ -24,7 +24,7 @@ import java.util.Collection;
/**
* Represents a parameter of a protocol.
*
*
* @author Michael Jumper
*/
public class ProtocolParameter {
@@ -60,7 +60,7 @@ public class ProtocolParameter {
*/
ENUM
}
/**
* The unique name that identifies this parameter to the protocol plugin.
*/
@@ -75,18 +75,18 @@ public class ProtocolParameter {
* The type of this field.
*/
private Type type;
/**
* The value of this parameter, for boolean parameters.
*/
private String value;
/**
* A collection of all associated parameter options.
*/
private Collection<ProtocolParameterOption> options =
new ArrayList<ProtocolParameterOption>();
/**
* Returns the name associated with this protocol parameter.
* @return The name associated with this protocol parameter.
@@ -99,7 +99,7 @@ public class ProtocolParameter {
* Sets the name associated with this protocol parameter. This name must
* uniquely identify this parameter among the others accepted by the
* corresponding protocol.
*
*
* @param name The name to assign to this protocol parameter.
*/
public void setName(String name) {
@@ -117,7 +117,7 @@ public class ProtocolParameter {
/**
* Sets the title associated with this protocol parameter. The title must
* be a human-readable string which describes accurately this parameter.
*
*
* @param title A human-readable string describing this parameter.
*/
public void setTitle(String title) {
@@ -135,7 +135,7 @@ public class ProtocolParameter {
/**
* Sets the value associated with this protocol parameter. The value must
* be a human-readable string which describes accurately this parameter.
*
*
* @param value A human-readable string describing this parameter.
*/
public void setValue(String value) {
@@ -161,7 +161,7 @@ public class ProtocolParameter {
/**
* Returns a mutable collection of protocol parameter options. Changes to
* this collection directly affect the available options.
*
*
* @return A mutable collection of parameter options.
*/
public Collection<ProtocolParameterOption> getOptions() {

View File

@@ -21,7 +21,7 @@ package net.sourceforge.guacamole.net.basic;
/**
* Describes an available legal value for an enumerated protocol parameter.
*
*
* @author Michael Jumper
*/
public class ProtocolParameterOption {
@@ -31,16 +31,16 @@ public class ProtocolParameterOption {
* chosen.
*/
private String value;
/**
* A human-readable title describing the effect of the value.
*/
private String title;
/**
* Returns the value that will be sent to the client plugin if this option
* Returns the value that will be sent to the client plugin if this option
* is chosen.
*
*
* @return The value that will be sent if this option is chosen.
*/
public String getValue() {
@@ -50,7 +50,7 @@ public class ProtocolParameterOption {
/**
* Sets the value that will be sent to the client plugin if this option is
* chosen.
*
*
* @param value The value to send if this option is chosen.
*/
public void setValue(String value) {
@@ -72,5 +72,5 @@ public class ProtocolParameterOption {
public void setTitle(String title) {
this.title = title;
}
}

View File

@@ -99,7 +99,7 @@ public class List extends AuthenticatingHttpServlet {
// Sys-admin permission
Permission systemPermission =
new SystemPermission(SystemPermission.Type.ADMINISTER);
// Write actual XML
try {

View File

@@ -66,10 +66,10 @@ public class List extends AuthenticatingHttpServlet {
*/
private static final String[] KNOWN_PROTOCOLS = new String[]{
"vnc", "rdp", "ssh"};
/**
* Parses the given XML file, returning the parsed ProtocolInfo.
*
*
* @param input An input stream containing XML describing the parameters
* associated with a protocol supported by Guacamole.
* @return A new ProtocolInfo object which contains the parameters described
@@ -115,7 +115,7 @@ public class List extends AuthenticatingHttpServlet {
/**
* Given an XML stream and a fully-populated ProtocolInfo object, writes
* out the corresponding protocol XML describing all available parameters.
*
*
* @param xml The XMLStreamWriter to use to write the XML.
* @param protocol The ProtocolInfo object to read parameters and protocol
* information from.
@@ -124,7 +124,7 @@ public class List extends AuthenticatingHttpServlet {
private void writeProtocol(XMLStreamWriter xml, ProtocolInfo protocol)
throws XMLStreamException {
// Write protocol
// Write protocol
xml.writeStartElement("protocol");
xml.writeAttribute("name", protocol.getName());
xml.writeAttribute("title", protocol.getTitle());
@@ -170,9 +170,9 @@ public class List extends AuthenticatingHttpServlet {
default:
throw new UnsupportedOperationException(
"Parameter type not supported: " + param.getType());
}
// Write options
for (ProtocolParameterOption option : param.getOptions()) {
xml.writeStartElement("option");
@@ -183,14 +183,14 @@ public class List extends AuthenticatingHttpServlet {
// End parameter
xml.writeEndElement();
}
// End protocol
// End protocol
xml.writeEndElement();
}
@Override
protected void authenticatedService(
UserContext context,
@@ -241,7 +241,7 @@ public class List extends AuthenticatingHttpServlet {
}
}
}
// If known protocols are not already defined, read from classpath
@@ -261,7 +261,7 @@ public class List extends AuthenticatingHttpServlet {
}
}
// Write actual XML
try {
// Write XML content type
@@ -277,7 +277,7 @@ public class List extends AuthenticatingHttpServlet {
// Write all protocols
for (ProtocolInfo protocol : protocols.values())
writeProtocol(xml, protocol);
// End document
xml.writeEndElement();
xml.writeEndDocument();

View File

@@ -113,7 +113,7 @@ public class DocumentHandler extends DefaultHandler {
// Initialize handler
handler.init(attributes);
// Append new element state to stack
stack.addLast(new DocumentHandlerState(handler));

View File

@@ -45,13 +45,13 @@ public interface TagHandler {
/**
* Called when the element corresponding to this TagHandler is first seen,
* just after an instance is created.
*
*
* @param attributes The attributes of the element seen.
* @throws SAXException If an error prevents a the TagHandler from being
* from being initialized.
*/
public void init(Attributes attributes) throws SAXException;
/**
* Called when this element, and all child elements, have been fully parsed,
* and the entire text content of this element (if any) is available.

View File

@@ -25,8 +25,8 @@ import org.xml.sax.SAXException;
/**
* TagHandler for the "option" element.
*
* @author Mike Jumper
*
* @author Mike Jumper
*/
public class OptionTagHandler implements TagHandler {
@@ -34,12 +34,12 @@ public class OptionTagHandler implements TagHandler {
* The option backing this option tag.
*/
private ProtocolParameterOption option = new ProtocolParameterOption();
@Override
public void init(Attributes attributes) throws SAXException {
option.setValue(attributes.getValue("value"));
}
@Override
public TagHandler childElement(String localName) throws SAXException {
throw new SAXException("The 'param' tag can contain no elements.");
@@ -57,5 +57,5 @@ public class OptionTagHandler implements TagHandler {
public ProtocolParameterOption asProtocolParameterOption() {
return option;
}
}

View File

@@ -25,8 +25,8 @@ import org.xml.sax.SAXException;
/**
* TagHandler for the "param" element.
*
* @author Mike Jumper
*
* @author Mike Jumper
*/
public class ParamTagHandler implements TagHandler {
@@ -34,7 +34,7 @@ public class ParamTagHandler implements TagHandler {
* The ProtocolParameter backing this tag handler.
*/
private ProtocolParameter protocolParameter = new ProtocolParameter();
@Override
public void init(Attributes attributes) throws SAXException {
@@ -64,7 +64,7 @@ public class ParamTagHandler implements TagHandler {
// Boolean field
else if ("boolean".equals(type)) {
protocolParameter.setType(ProtocolParameter.Type.BOOLEAN);
if(protocolParameter.getValue() == null)
throw new SAXException
("A value is required for the boolean parameter type.");
@@ -73,15 +73,15 @@ public class ParamTagHandler implements TagHandler {
// Otherwise, fail with unrecognized type
else
throw new SAXException("Invalid parameter type: " + type);
}
@Override
public TagHandler childElement(String localName) throws SAXException {
// Start parsing of option tags
// Start parsing of option tags
if (localName.equals("option")) {
// Get tag handler for option tag
OptionTagHandler tagHandler = new OptionTagHandler();
@@ -89,7 +89,7 @@ public class ParamTagHandler implements TagHandler {
protocolParameter.getOptions().add(
tagHandler.asProtocolParameterOption());
return tagHandler;
}
return null;

View File

@@ -25,8 +25,8 @@ import org.xml.sax.SAXException;
/**
* TagHandler for the "protocol" element.
*
* @author Mike Jumper
*
* @author Mike Jumper
*/
public class ProtocolTagHandler implements TagHandler {
@@ -35,30 +35,30 @@ public class ProtocolTagHandler implements TagHandler {
* handler.
*/
private ProtocolInfo info = new ProtocolInfo();
@Override
public void init(Attributes attributes) throws SAXException {
info.setName(attributes.getValue("name"));
info.setTitle(attributes.getValue("title"));
}
@Override
public TagHandler childElement(String localName) throws SAXException {
// Start parsing of param tags, add to list of all parameters
// Start parsing of param tags, add to list of all parameters
if (localName.equals("param")) {
// Get tag handler for param tag
ParamTagHandler tagHandler = new ParamTagHandler();
// Store stub in parameters collection
info.getParameters().add(tagHandler.asProtocolParameter());
return tagHandler;
}
return null;
}
@Override

View File

@@ -49,18 +49,18 @@ public class AuthorizeTagHandler implements TagHandler {
* The UserMapping this authorization belongs to.
*/
private UserMapping parent;
/**
* Creates a new AuthorizeTagHandler that parses an Authorization owned
* by the given UserMapping.
*
*
* @param parent The UserMapping that owns the Authorization this handler
* will parse.
*/
public AuthorizeTagHandler(UserMapping parent) {
this.parent = parent;
}
@Override
public void init(Attributes attributes) throws SAXException {
@@ -88,7 +88,7 @@ public class AuthorizeTagHandler implements TagHandler {
}
parent.addAuthorization(this.asAuthorization());
}
@Override

View File

@@ -45,18 +45,18 @@ public class ConnectionTagHandler implements TagHandler {
* The Authorization this connection belongs to.
*/
private Authorization parent;
/**
* Creates a new ConnectionTagHandler that parses a Connection owned by
* the given Authorization.
*
*
* @param parent The Authorization that will own this Connection once
* parsed.
*/
public ConnectionTagHandler(Authorization parent) {
this.parent = parent;
}
@Override
public void init(Attributes attributes) throws SAXException {
name = attributes.getValue("name");