1 16 package org.apache.html.dom; 17 18 import org.w3c.dom.Node ; 19 import org.w3c.dom.NodeList ; 20 import org.w3c.dom.html.HTMLCollection; 21 import org.w3c.dom.html.HTMLFormElement; 22 23 30 public class HTMLFormElementImpl 31 extends HTMLElementImpl 32 implements HTMLFormElement 33 { 34 35 private static final long serialVersionUID = 3690757284875876658L; 36 37 public HTMLCollection getElements() 38 { 39 if ( _elements == null ) 40 _elements = new HTMLCollectionImpl( this, HTMLCollectionImpl.ELEMENT ); 41 return _elements; 42 } 43 44 45 public int getLength() 46 { 47 return getElements().getLength(); 48 } 49 50 51 public String getName() 52 { 53 return getAttribute( "name" ); 54 } 55 56 57 public void setName( String name ) 58 { 59 setAttribute( "name", name ); 60 } 61 62 63 public String getAcceptCharset() 64 { 65 return getAttribute( "accept-charset" ); 66 } 67 68 69 public void setAcceptCharset( String acceptCharset ) 70 { 71 setAttribute( "accept-charset", acceptCharset ); 72 } 73 74 75 public String getAction() 76 { 77 return getAttribute( "action" ); 78 } 79 80 81 public void setAction( String action ) 82 { 83 setAttribute( "action", action ); 84 } 85 86 87 public String getEnctype() 88 { 89 return getAttribute( "enctype" ); 90 } 91 92 93 public void setEnctype( String enctype ) 94 { 95 setAttribute( "enctype", enctype ); 96 } 97 98 99 public String getMethod() 100 { 101 return capitalize( getAttribute( "method" ) ); 102 } 103 104 105 public void setMethod( String method ) 106 { 107 setAttribute( "method", method ); 108 } 109 110 111 public String getTarget() 112 { 113 return getAttribute( "target" ); 114 } 115 116 117 public void setTarget( String target ) 118 { 119 setAttribute( "target", target ); 120 } 121 122 123 public void submit() 124 { 125 } 127 128 129 public void reset() 130 { 131 } 133 134 138 public NodeList getChildNodes() { 139 return getChildNodesUnoptimized(); 140 } 141 142 146 public Node cloneNode( boolean deep ) { 147 HTMLFormElementImpl clonedNode = (HTMLFormElementImpl)super.cloneNode( deep ); 148 clonedNode._elements = null; 149 return clonedNode; 150 } 151 152 157 public HTMLFormElementImpl( HTMLDocumentImpl owner, String name ) 158 { 159 super( owner, name ); 160 } 161 162 163 166 private HTMLCollectionImpl _elements; 167 168 } 169 170 | Popular Tags |