001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.html.dom;
018:
019: import org.w3c.dom.html.HTMLAnchorElement;
020:
021: /**
022: * @xerces.internal
023: * @version $Revision: 447255 $ $Date: 2006-09-18 01:36:42 -0400 (Mon, 18 Sep 2006) $
024: * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
025: * @see org.w3c.dom.html.HTMLAnchorElement
026: * @see org.apache.xerces.dom.ElementImpl
027: */
028: public class HTMLAnchorElementImpl extends HTMLElementImpl implements
029: HTMLAnchorElement {
030: private static final long serialVersionUID = -140558580924061847L;
031:
032: public String getAccessKey() {
033: String accessKey;
034:
035: // Make sure that the access key is a single character.
036: accessKey = getAttribute("accesskey");
037: if (accessKey != null && accessKey.length() > 1)
038: accessKey = accessKey.substring(0, 1);
039: return accessKey;
040: }
041:
042: public void setAccessKey(String accessKey) {
043: // Make sure that the access key is a single character.
044: if (accessKey != null && accessKey.length() > 1)
045: accessKey = accessKey.substring(0, 1);
046: setAttribute("accesskey", accessKey);
047: }
048:
049: public String getCharset() {
050: return getAttribute("charset");
051: }
052:
053: public void setCharset(String charset) {
054: setAttribute("charset", charset);
055: }
056:
057: public String getCoords() {
058: return getAttribute("coords");
059: }
060:
061: public void setCoords(String coords) {
062: setAttribute("coords", coords);
063: }
064:
065: public String getHref() {
066: return getAttribute("href");
067: }
068:
069: public void setHref(String href) {
070: setAttribute("href", href);
071: }
072:
073: public String getHreflang() {
074: return getAttribute("hreflang");
075: }
076:
077: public void setHreflang(String hreflang) {
078: setAttribute("hreflang", hreflang);
079: }
080:
081: public String getName() {
082: return getAttribute("name");
083: }
084:
085: public void setName(String name) {
086: setAttribute("name", name);
087: }
088:
089: public String getRel() {
090: return getAttribute("rel");
091: }
092:
093: public void setRel(String rel) {
094: setAttribute("rel", rel);
095: }
096:
097: public String getRev() {
098: return getAttribute("rev");
099: }
100:
101: public void setRev(String rev) {
102: setAttribute("rev", rev);
103: }
104:
105: public String getShape() {
106: return capitalize(getAttribute("shape"));
107: }
108:
109: public void setShape(String shape) {
110: setAttribute("shape", shape);
111: }
112:
113: public int getTabIndex() {
114: return this .getInteger(getAttribute("tabindex"));
115: }
116:
117: public void setTabIndex(int tabIndex) {
118: setAttribute("tabindex", String.valueOf(tabIndex));
119: }
120:
121: public String getTarget() {
122: return getAttribute("target");
123: }
124:
125: public void setTarget(String target) {
126: setAttribute("target", target);
127: }
128:
129: public String getType() {
130: return getAttribute("type");
131: }
132:
133: public void setType(String type) {
134: setAttribute("type", type);
135: }
136:
137: public void blur() {
138: // No scripting in server-side DOM. This method is moot.
139: }
140:
141: public void focus() {
142: // No scripting in server-side DOM. This method is moot.
143: }
144:
145: /**
146: * Constructor requires owner document.
147: *
148: * @param owner The owner HTML document
149: */
150: public HTMLAnchorElementImpl(HTMLDocumentImpl owner, String name) {
151: super(owner, name);
152: }
153:
154: }
|