// Copyright 2012 Georg-August-Universität Göttingen, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package de.ugoe.cs.autoquest.htmlmonitor; import java.util.ArrayList; import java.util.List; /** *
* represents an element of an HTML GUI. This can be a server, which is usually the root of a * GUI structure, a web page, or a tag within a web page. *
* * @author Patrick Harms */ abstract class HtmlGUIElement { /** * the children of this element */ private List* instantiates a new GUI element *
* * @param parentId the parent GUI element, null if none is present */ protected HtmlGUIElement(String id, HtmlGUIElement parent) { if (id == null) { throw new IllegalArgumentException("id must not be null"); } this.id = id; this.parent = parent; } /** ** returns the children of this element if any, null else *
* * @return the children */ List* returns the id of the parent GUI element, if any *
* * @return the id of the parent GUI element, or null, if this element does not have a parent */ String getParentId() { if (parent == null) { return null; } else { return parent.getId(); } } }