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#HTMLLIElement} class.</p>
028  * <p>This class represents a list item 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * tag <tt>&lt;li&gt;</tt>.</p> 
031  *
032  * @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>
033  *
034  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
035  * generated into the target codes. Re-compilers must exit with error on the operations of
036  * accessing that kind of class objects.
037  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
038  * and <tt>instanceof</tt> to it always <tt>true</tt>.
039  */
040 public class JsHTMLLIElement extends JsClient.HTMLLIElement.Prototype
041 {
042     /**
043      * <p>An <b>internal</b> class containing membership data for its enclosing
044      * opaque class.</p>
045      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
046      * class members.</p>
047      *
048      * @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>
049      * 
050      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
051      */
052     protected static abstract class Members extends JsClient.HTMLLIElement.Prototype.Members
053     {
054         /**
055          * <p>An <b>internal</b> static field defining a member ID of the field name and
056          * used internally to define a member of the same name.</p>
057          * @since 1.0
058          * @see JsHTMLLIElement#type
059          * @see JsHTMLLIElement.Member#type
060          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
061          */
062         public final static Mid type  = id("type" );
063         /**
064          * <p>An <b>internal</b> static field defining a member ID of the field name and
065          * used internally to define a member of the same name.</p>
066          * @since 1.0
067          * @see JsHTMLLIElement#value
068          * @see JsHTMLLIElement.Member#value
069          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
070          */
071         public final static Mid value = id("value");
072     }
073     /**
074      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
075      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
076      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
077      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
078      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
079      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
080      * either circumstance, the field names must be exactly same as the member names, as 
081      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
082      * based on the field names.</p>
083      *
084      * @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>
085      * 
086      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
087      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
088      * of class objects.
089      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
090      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
091      * <pre>q.m</pre>
092      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
093      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
094      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
095      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
096      * <pre>m</pre>
097      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
098      * error on the access to <b>opaque</b> fields declared by this class under any other 
099      * circumstances.
100      */
101     public static class Member extends JsClient.HTMLLIElement.Prototype.Member
102     {
103         /**
104          * <p>Internally constructs a member based on a qualifying member.</p>
105          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
106          * or <b>internal</b> classes or class members.</p>
107          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
108          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
109          * declared in the declaring class of this constructor itself or its subclasses. 
110          * Under this circumstance, the field names must be exactly same as the member 
111          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
112          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
113          * to their names appending to the name resolved from the specified qualifying 
114          * member with a dot in between.</p>
115          * @param q A qualifying member
116          * @param mid The ID of the member to construct
117          * @since 1.0
118          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
119          */
120         public Member(JsObject.Member q, Mid mid) {
121             super(q, mid);
122         }
123         /**
124          * <p>Internally constructs a member without a qualifying member.</p>
125          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
126          * or <b>internal</b> classes or class members.</p>
127          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
128          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
129          * declared in <b>opaque</b> types other than the declaring class of this constructor 
130          * itself and its subclasses. Under this circumstance, the field names must be
131          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
132          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
133          * @param mid The ID of the member to construct
134          * @since 1.0
135          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
136          */
137         public Member(Mid mid) {
138             super(mid);
139         }
140         @Override
141         /**
142          * <p>Evaluates the property, represented by the current member instance, of the
143          * argument object.</p>
144          * @param o The argument object
145          * @return The value of the current member based on the object argument.
146          * @since 1.0
147          * @javascript Re-compilers must convert the instance invocation of this method into
148          * the JavaScript expression: 
149          * <pre>o.m</pre>
150          * where <tt>m</tt> is the identifier name resolved from the current member
151          * instance of the invocation.
152          */
153         public JsHTMLLIElement with(ObjectLike o) {
154             return new JsHTMLLIElement(super.with(o));
155         }
156 
157         /**
158          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
159          * name of this field, qualified by the current member instance of the field, and 
160          * to access the property of the name on an object.</p>
161          * <p>The property, identified by this member, of a {@link JsHTMLLIElement} 
162          * object refers to a string specifying the type of bullet style of this list 
163          * item. See {@link JsHTMLOListElement#type} and {@link JsHTMLUListElement#type} 
164          * for the possible values.</p> 
165          * @since 1.0
166          * @javascript Re-compilers must resolve the member of this instance field to the
167          * identifier of the field name appending to the identifier resolved from its 
168          * qualifying member with a dot in between.
169          */
170         public final Value.String.Member type  = new Value.String.Member(this, Members.type );
171         /**
172          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
173          * name of this field, qualified by the current member instance of the field, and 
174          * to access the property of the name on an object.</p>
175          * <p>The property, identified by this member, of a {@link JsHTMLLIElement} 
176          * object refers to an integer value that resets its sequence number when used 
177          * in an ordered list, that is, a {@link JsHTMLOListElement} object.</p> 
178          * @since 1.0
179          * @javascript Re-compilers must resolve the member of this instance field to the
180          * identifier of the field name appending to the identifier resolved from its 
181          * qualifying member with a dot in between.
182          */
183         public final Value.Number.Member value = new Value.Number.Member(this, Members.value);
184     }
185 
186     /**
187      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
188      * with the wrapping constructor.</p>
189      * @param var The argument of an <b>opaque</b> object.
190      * @since 1.0
191      * @javascript Re-compilers must ignore the construction operation of this constructor,
192      * that is, replacing it with its only argument.
193      */
194     public JsHTMLLIElement(JsObject var) {
195         super(var);
196     }
197 
198     /**
199      * <p>An <b>opaque</b> static field defining a member that is named by the field name
200      * without a qualifying member and to access the property of the name on an object.</p>
201      * <p>The property, identified by this member, of a {@link JsHTMLLIElement} 
202      * object refers to a string specifying the type of bullet style of this list 
203      * item. See {@link JsHTMLOListElement#type} and {@link JsHTMLUListElement#type} 
204      * for the possible values.</p> 
205      * @since 1.0
206      * @javascript Re-compilers must resolve the member of this static field to the
207      * identifier of the field name.
208      */
209     public static final Value.String.Member type  = new Value.String.Member(Members.type );
210     /**
211      * <p>An <b>opaque</b> static field defining a member that is named by the field name
212      * without a qualifying member and to access the property of the name on an object.</p>
213      * <p>The property, identified by this member, of a {@link JsHTMLLIElement} 
214      * object refers to an integer value that resets its sequence number when used 
215      * in an ordered list, that is, a {@link JsHTMLOListElement} object.</p> 
216      * @since 1.0
217      * @javascript Re-compilers must resolve the member of this static field to the
218      * identifier of the field name.
219      */
220     public static final Value.Number.Member value = new Value.Number.Member(Members.value);
221 
222     @Override
223     /**
224      * <p>Returns the primitive value associated with the current instance, if there is one.
225      * This invocation simply returns the instance itself for the current instance is an 
226      * object and there is no primitive value for it.</p>
227      * @return The current object itself.
228      * @since 1.0
229      * @javascript Re-compilers must convert the instance invocation of this method directly
230      * into a JavaScript invocation on its current object instance without changing the 
231      * method name, but expanding variable arguments, if any, into comma-separated values. 
232      */
233     public final JsHTMLLIElement valueOf() {
234         return new JsHTMLLIElement((JsObject)var().valueOf());
235     }
236 }