Viewpublic class View extends Object The internal representation of a view from the views.xml file |
Fields Summary |
---|
private HashMap | containersthe containers in this view, mapped by name | private String | templatethe template for this view |
Constructors Summary |
---|
public View(String template)Create a new view with the given template
containers = new HashMap();
this.template = template;
|
Methods Summary |
---|
public void | addInclude(java.lang.String container, java.lang.String name, java.lang.String url)Add an include to this view, given a container within the view,
the name of the include and the associated url
// find the container
Container c = (Container) containers.get(container);
// if the container doesn't exist, create it
if (c == null) {
c = new Container();
containers.put(container, c);
}
// add the include to the container
c.addInclude(name, url);
| public java.lang.String | getTemplate()Get the template associated with this view
return template;
| public java.lang.String | getUrl(java.lang.String container, java.lang.String name)Get the url associated with a named view
// find the container
Container c = (Container) containers.get(container);
if (c == null) {
return null;
}
// get the url
return c.getUrl(name);
| public boolean | hasContainer(java.lang.String container)Determine if this view has a container with the given name
return containers.containsKey(container);
|
|