KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lamatek > tags > google > GoogleMapKeyTag


1 package com.lamatek.tags.google;
2
3 import java.io.Serializable JavaDoc;
4
5 import javax.servlet.jsp.tagext.Tag JavaDoc;
6 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
7
8 /**
9  * GoogleMapKeyTag
10  *
11  * This tag represents a <googlemaps:key> tag. Developers should not extend or override this class.
12  *
13  * @author Tom Cole
14  * @version 0.40
15  */

16 public class GoogleMapKeyTag extends TagSupport JavaDoc implements Serializable JavaDoc {
17     
18     String JavaDoc key = null;
19     String JavaDoc domain = null;
20     /**
21      * Overrides doEndTag() from TagSupport. Developers should not override this method.
22      */

23     public int doEndTag() {
24         Tag JavaDoc tag = this;
25         while (tag.getParent() != null) {
26             if (tag.getParent() instanceof GoogleMapTag) {
27                 ((GoogleMapTag) tag.getParent()).addKey(this);
28                 return EVAL_PAGE;
29             }
30             tag = tag.getParent();
31         }
32         return EVAL_PAGE;
33     }
34     /**
35      * Sets the domain name (i.e. www.lamatek.com) that this key was issued for.
36      *
37      * @param domain This key's registered domain.
38      */

39     public void setDomain(String JavaDoc domain) {
40         this.domain = domain;
41     }
42     /**
43      * Sets the Google Maps API key that refers to this key's domain.
44      *
45      * @param key A valid Google Maps API key for the current domain.
46      */

47     public void setKey(String JavaDoc key) {
48         this.key = key;
49     }
50 }
51
Popular Tags