001 
002 /*
003  *  JScripter Standard 1.0 - To Script In Java
004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
005  *  
006  *  This program is free software: you can redistribute it and/or modify
007  *  it under the terms of the GNU Affero General Public License as published by
008  *  the Free Software Foundation, either version 3 of the License, or
009  *  (at your option) any later version.
010  *  
011  *  This program is distributed in the hope that it will be useful,
012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014  *  GNU Affero General Public License for more details.
015  *  
016  *  You should have received a copy of the GNU Affero General Public License
017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
018  */
019 
020 package js.user;
021 
022 import js.*;
023 import js.core.*;
024 
025 /**
026  * <p>An <b>opaque</b> class representing JavaScript client-side objects of the global 
027  * {@link JsClient#HTMLMetaElement} class.</p>
028  * <p>This class represents a meta element 
029  * in an HTML document, or a {@link JsHTMLElement} object created with the HTML 
030  * tag <tt>&lt;meta&gt;</tt> which lets the HTML authors specify meta data, information 
031  * about the HTML document rather than document content, in a variety of ways.</p> 
032  *
033  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
034  *
035  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
036  * generated into the target codes. Re-compilers must exit with error on the operations of
037  * accessing that kind of class objects.
038  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
039  * and <tt>instanceof</tt> to it always <tt>true</tt>.
040  */
041 public class JsHTMLMetaElement extends JsClient.HTMLMetaElement.Prototype
042 {
043     /**
044      * <p>An <b>internal</b> class containing membership data for its enclosing
045      * opaque class.</p>
046      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
047      * class members.</p>
048      *
049      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
050      * 
051      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
052      */
053     protected static abstract class Members extends JsClient.HTMLMetaElement.Prototype.Members
054     {
055         /**
056          * <p>An <b>internal</b> static field defining a member ID of the field name and
057          * used internally to define a member of the same name.</p>
058          * @since 1.0
059          * @see JsHTMLMetaElement#content
060          * @see JsHTMLMetaElement.Member#content
061          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
062          */
063         public final static Mid content   = id("content"  );
064         /**
065          * <p>An <b>internal</b> static field defining a member ID of the field name and
066          * used internally to define a member of the same name.</p>
067          * @since 1.0
068          * @see JsHTMLMetaElement#httpEquiv
069          * @see JsHTMLMetaElement.Member#httpEquiv
070          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
071          */
072         public final static Mid httpEquiv = id("httpEquiv");
073         /**
074          * <p>An <b>internal</b> static field defining a member ID of the field name and
075          * used internally to define a member of the same name.</p>
076          * @since 1.0
077          * @see JsHTMLMetaElement#name
078          * @see JsHTMLMetaElement.Member#name
079          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
080          */
081         public final static Mid name      = id("name"     );
082         /**
083          * <p>An <b>internal</b> static field defining a member ID of the field name and
084          * used internally to define a member of the same name.</p>
085          * @since 1.0
086          * @see JsHTMLMetaElement#scheme
087          * @see JsHTMLMetaElement.Member#scheme
088          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
089          */
090         public final static Mid scheme    = id("scheme"   );
091     }
092     /**
093      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
094      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
095      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
096      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
097      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
098      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
099      * either circumstance, the field names must be exactly same as the member names, as 
100      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
101      * based on the field names.</p>
102      *
103      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
104      * 
105      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
106      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
107      * of class objects.
108      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
109      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
110      * <pre>q.m</pre>
111      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
112      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
113      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
114      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
115      * <pre>m</pre>
116      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
117      * error on the access to <b>opaque</b> fields declared by this class under any other 
118      * circumstances.
119      */
120     public static class Member extends JsClient.HTMLMetaElement.Prototype.Member
121     {
122         /**
123          * <p>Internally constructs a member based on a qualifying member.</p>
124          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
125          * or <b>internal</b> classes or class members.</p>
126          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
127          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
128          * declared in the declaring class of this constructor itself or its subclasses. 
129          * Under this circumstance, the field names must be exactly same as the member 
130          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
131          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
132          * to their names appending to the name resolved from the specified qualifying 
133          * member with a dot in between.</p>
134          * @param q A qualifying member
135          * @param mid The ID of the member to construct
136          * @since 1.0
137          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
138          */
139         public Member(JsObject.Member q, Mid mid) {
140             super(q, mid);
141         }
142         /**
143          * <p>Internally constructs a member without a qualifying member.</p>
144          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
145          * or <b>internal</b> classes or class members.</p>
146          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
147          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
148          * declared in <b>opaque</b> types other than the declaring class of this constructor 
149          * itself and its subclasses. Under this circumstance, the field names must be
150          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
151          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
152          * @param mid The ID of the member to construct
153          * @since 1.0
154          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
155          */
156         public Member(Mid mid) {
157             super(mid);
158         }
159         @Override
160         /**
161          * <p>Evaluates the property, represented by the current member instance, of the
162          * argument object.</p>
163          * @param o The argument object
164          * @return The value of the current member based on the object argument.
165          * @since 1.0
166          * @javascript Re-compilers must convert the instance invocation of this method into
167          * the JavaScript expression: 
168          * <pre>o.m</pre>
169          * where <tt>m</tt> is the identifier name resolved from the current member
170          * instance of the invocation.
171          */
172         public JsHTMLMetaElement with(ObjectLike o) {
173             return new JsHTMLMetaElement(super.with(o));
174         }
175 
176         /**
177          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
178          * name of this field, qualified by the current member instance of the field, and 
179          * to access the property of the name on an object.</p>
180          * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
181          * object refers to a string specifying information associated with {@link #name}.</p> 
182          * @since 1.0
183          * @javascript Re-compilers must resolve the member of this instance field to the
184          * identifier of the field name appending to the identifier resolved from its 
185          * qualifying member with a dot in between.
186          */
187         public final Value.String.Member content   = new Value.String.Member(this, Members.content  );
188         /**
189          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
190          * name of this field, qualified by the current member instance of the field, and 
191          * to access the property of the name on an object.</p>
192          * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
193          * object refers to a string specifying the HTTP response header name used by the 
194          * HTTP servers to gather information for HTTP response message headers.</p> 
195          * @since 1.0
196          * @javascript Re-compilers must resolve the member of this instance field to the
197          * identifier of the field name appending to the identifier resolved from its 
198          * qualifying member with a dot in between.
199          */
200         public final Value.String.Member httpEquiv = new Value.String.Member(this, Members.httpEquiv);
201         /**
202          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
203          * name of this field, qualified by the current member instance of the field, and 
204          * to access the property of the name on an object.</p>
205          * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
206          * object refers to a string specifying the name of the meta information.</p> 
207          * @since 1.0
208          * @javascript Re-compilers must resolve the member of this instance field to the
209          * identifier of the field name appending to the identifier resolved from its 
210          * qualifying member with a dot in between.
211          */
212         public final Value.String.Member name      = new Value.String.Member(this, Members.name     );
213         /**
214          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
215          * name of this field, qualified by the current member instance of the field, and 
216          * to access the property of the name on an object.</p>
217          * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
218          * object refers to a string specifying the name of a scheme to be used to 
219          * interpret {@link #content}.</p> 
220          * @since 1.0
221          * @javascript Re-compilers must resolve the member of this instance field to the
222          * identifier of the field name appending to the identifier resolved from its 
223          * qualifying member with a dot in between.
224          */
225         public final Value.String.Member scheme    = new Value.String.Member(this, Members.scheme   );
226     }
227 
228     /**
229      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
230      * with the wrapping constructor.</p>
231      * @param var The argument of an <b>opaque</b> object.
232      * @since 1.0
233      * @javascript Re-compilers must ignore the construction operation of this constructor,
234      * that is, replacing it with its only argument.
235      */
236     public JsHTMLMetaElement(JsObject var) {
237         super(var);
238     }
239 
240     /**
241      * <p>An <b>opaque</b> static field defining a member that is named by the field name
242      * without a qualifying member and to access the property of the name on an object.</p>
243      * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
244      * object refers to a string specifying information associated with {@link #name}.</p> 
245      * @since 1.0
246      * @javascript Re-compilers must resolve the member of this static field to the
247      * identifier of the field name.
248      */
249     public static final Value.String.Member content   = new Value.String.Member(Members.content  );
250     /**
251      * <p>An <b>opaque</b> static field defining a member that is named by the field name
252      * without a qualifying member and to access the property of the name on an object.</p>
253      * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
254      * object refers to a string specifying the HTTP response header name used by the 
255      * HTTP servers to gather information for HTTP response message headers.</p> 
256      * @since 1.0
257      * @javascript Re-compilers must resolve the member of this static field to the
258      * identifier of the field name.
259      */
260     public static final Value.String.Member httpEquiv = new Value.String.Member(Members.httpEquiv);
261     /**
262      * <p>An <b>opaque</b> static field defining a member that is named by the field name
263      * without a qualifying member and to access the property of the name on an object.</p>
264      * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
265      * object refers to a string specifying the name of the meta information.</p> 
266      * @since 1.0
267      * @javascript Re-compilers must resolve the member of this static field to the
268      * identifier of the field name.
269      */
270     public static final Value.String.Member name      = new Value.String.Member(Members.name     );
271     /**
272      * <p>An <b>opaque</b> static field defining a member that is named by the field name
273      * without a qualifying member and to access the property of the name on an object.</p>
274      * <p>The property, identified by this member, of a {@link JsHTMLMetaElement} 
275      * object refers to a string specifying the name of a scheme to be used to 
276      * interpret {@link #content}.</p> 
277      * @since 1.0
278      * @javascript Re-compilers must resolve the member of this static field to the
279      * identifier of the field name.
280      */
281     public static final Value.String.Member scheme    = new Value.String.Member(Members.scheme   );
282 
283     @Override
284     /**
285      * <p>Returns the primitive value associated with the current instance, if there is one.
286      * This invocation simply returns the instance itself for the current instance is an 
287      * object and there is no primitive value for it.</p>
288      * @return The current object itself.
289      * @since 1.0
290      * @javascript Re-compilers must convert the instance invocation of this method directly
291      * into a JavaScript invocation on its current object instance without changing the 
292      * method name, but expanding variable arguments, if any, into comma-separated values. 
293      */
294     public final JsHTMLMetaElement valueOf() {
295         return new JsHTMLMetaElement((JsObject)var().valueOf());
296     }
297 }