source: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServer.java @ 1276

Last change on this file since 1276 was 1276, checked in by pharms, 11 years ago
  • added some Java Docs
File size: 2.6 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.plugin.html.guimodel;
16
17import de.ugoe.cs.autoquest.eventcore.guimodel.IFrame;
18
19/**
20 * <p>
21 * a GUI element representing an HTML server. This is the root element for a GUI model of
22 * an HTML web site. It is identified through a host and a port. Its children are documents.
23 * </p>
24 *
25 * @author Patrick Harms
26 */
27public class HTMLServer extends HTMLGUIElement implements IFrame {
28
29    /**
30     * <p>
31     * default serial version UID
32     * </p>
33     */
34    private static final long serialVersionUID = 1L;
35
36    /**
37     * <p>
38     * instantiates the server with an appropriate specification
39     * </p>
40     *
41     * @param specification the server specification
42     * @param parent        the parent of the server --> must always be null. Just included as
43     *                      required by the automatic instantiation mechanism
44     *                     
45     * @throws IllegalArgumentException if the provided parent is not null
46     */
47    public HTMLServer(HTMLServerSpec specification, HTMLGUIElement parent) {
48        super(specification, null);
49       
50        if (parent != null) {
51            throw new IllegalArgumentException("a GUI element representing the server must not " +
52                                               "have a parent GUI element");
53        }
54    }
55
56    /*
57     * (non-Javadoc)
58     *
59     * @see de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement#getElementDescriptor()
60     */
61    @Override
62    protected String getElementDescriptor() {
63        return "Server";
64    }
65
66    /**
67     * <p>
68     * returns the host of the represented server
69     * </p>
70     *
71     * @return the host
72     */
73    public String getHost() {
74        return ((HTMLServerSpec) super.getSpecification()).getHost();
75    }
76
77    /**
78     * <p>
79     * returns the port of the represented server
80     * </p>
81     *
82     * @return the port
83     */
84    public int getPort() {
85        return ((HTMLServerSpec) super.getSpecification()).getPort();
86    }
87
88}
Note: See TracBrowser for help on using the repository browser.