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#HTMLOListElement} class.</p>
028  * <p>This class represents an ordered list 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * <tt>&lt;ol&gt;</tt> tag.</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  * @see JsHTMLDListElement
034  * @see JsHTMLUListElement
035  *
036  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
037  * generated into the target codes. Re-compilers must exit with error on the operations of
038  * accessing that kind of class objects.
039  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
040  * and <tt>instanceof</tt> to it always <tt>true</tt>.
041  */
042 public class JsHTMLOListElement extends JsClient.HTMLOListElement.Prototype
043 {
044     /**
045      * <p>An <b>internal</b> class containing membership data for its enclosing
046      * opaque class.</p>
047      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
048      * class members.</p>
049      *
050      * @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>
051      * 
052      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
053      */
054     protected static abstract class Members extends JsClient.HTMLOListElement.Prototype.Members
055     {
056         /**
057          * <p>An <b>internal</b> static field defining a member ID of the field name and
058          * used internally to define a member of the same name.</p>
059          * @since 1.0
060          * @see JsHTMLOListElement#compact
061          * @see JsHTMLOListElement.Member#compact
062          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
063          */
064         public final static Mid compact = id("compact");
065         /**
066          * <p>An <b>internal</b> static field defining a member ID of the field name and
067          * used internally to define a member of the same name.</p>
068          * @since 1.0
069          * @see JsHTMLOListElement#start
070          * @see JsHTMLOListElement.Member#start
071          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
072          */
073         public final static Mid start   = id("start"  );
074         /**
075          * <p>An <b>internal</b> static field defining a member ID of the field name and
076          * used internally to define a member of the same name.</p>
077          * @since 1.0
078          * @see JsHTMLOListElement#type
079          * @see JsHTMLOListElement.Member#type
080          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
081          */
082         public final static Mid type    = id("type"   );
083     }
084     /**
085      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
086      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
087      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
088      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
089      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
090      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
091      * either circumstance, the field names must be exactly same as the member names, as 
092      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
093      * based on the field names.</p>
094      *
095      * @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>
096      * 
097      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
098      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
099      * of class objects.
100      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
101      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
102      * <pre>q.m</pre>
103      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
104      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
105      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
106      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
107      * <pre>m</pre>
108      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
109      * error on the access to <b>opaque</b> fields declared by this class under any other 
110      * circumstances.
111      */
112     public static class Member extends JsClient.HTMLOListElement.Prototype.Member
113     {
114         /**
115          * <p>Internally constructs a member based on a qualifying member.</p>
116          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
117          * or <b>internal</b> classes or class members.</p>
118          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
119          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
120          * declared in the declaring class of this constructor itself or its subclasses. 
121          * Under this circumstance, the field names must be exactly same as the member 
122          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
123          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
124          * to their names appending to the name resolved from the specified qualifying 
125          * member with a dot in between.</p>
126          * @param q A qualifying member
127          * @param mid The ID of the member to construct
128          * @since 1.0
129          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
130          */
131         public Member(JsObject.Member q, Mid mid) {
132             super(q, mid);
133         }
134         /**
135          * <p>Internally constructs a member without a qualifying member.</p>
136          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
137          * or <b>internal</b> classes or class members.</p>
138          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
139          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
140          * declared in <b>opaque</b> types other than the declaring class of this constructor 
141          * itself and its subclasses. Under this circumstance, the field names must be
142          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
143          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
144          * @param mid The ID of the member to construct
145          * @since 1.0
146          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
147          */
148         public Member(Mid mid) {
149             super(mid);
150         }
151         @Override
152         /**
153          * <p>Evaluates the property, represented by the current member instance, of the
154          * argument object.</p>
155          * @param o The argument object
156          * @return The value of the current member based on the object argument.
157          * @since 1.0
158          * @javascript Re-compilers must convert the instance invocation of this method into
159          * the JavaScript expression: 
160          * <pre>o.m</pre>
161          * where <tt>m</tt> is the identifier name resolved from the current member
162          * instance of the invocation.
163          */
164         public JsHTMLOListElement with(ObjectLike o) {
165             return new JsHTMLOListElement(super.with(o));
166         }
167 
168         /**
169          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
170          * name of this field, qualified by the current member instance of the field, and 
171          * to access the property of the name on an object.</p>
172          * <p>The property, identified by this member, of a {@link JsHTMLOListElement} 
173          * object refers to a boolean value specifying whether to reduce interitem spacing, 
174          * giving a hint to visual browsers to render the list in a more compact way.</p>
175          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
176          * @since 1.0
177          * @javascript Re-compilers must resolve the member of this instance field to the
178          * identifier of the field name appending to the identifier resolved from its 
179          * qualifying member with a dot in between.
180          */
181         public final Value.Boolean.Member compact = new Value.Boolean.Member(this, Members.compact);
182         /**
183          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
184          * name of this field, qualified by the current member instance of the field, and 
185          * to access the property of the name on an object.</p>
186          * <p>The property, identified by this member, of a {@link JsHTMLOListElement} 
187          * object refers to an integer value specifying the starting number of the first 
188          * item in an ordered list. The default starting number is "1". Note that while 
189          * the value of this attribute is an integer, the corresponding label may be 
190          * non-numeric. Thus, when the list item style is uppercase latin letters (A, B, C, ...), 
191          * the value 3 means "C". When the style is lowercase roman numerals, 3 means 
192          * "iii", etc.</p>
193          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
194          * @since 1.0
195          * @javascript Re-compilers must resolve the member of this instance field to the
196          * identifier of the field name appending to the identifier resolved from its 
197          * qualifying member with a dot in between.
198          */
199         public final Value.Number.Member start = new Value.Number.Member(this, Members.start);
200         /**
201          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
202          * name of this field, qualified by the current member instance of the field, and 
203          * to access the property of the name on an object.</p>
204          * <p>The property, identified by this member, of a {@link JsHTMLUListElement} 
205          * object refers to a string specifying the type of the ordered list. Possible 
206          * values for the type attribute are case-sensitive. The values and their meanings 
207          * are:
208          * <ul>
209          * <li><tt>"1"</tt>: arabic numbers like 1, 2, 3, ...</li>
210          * <li><tt>"a"</tt>: lower alphabetics like a, b, c, ...</li>
211          * <li><tt>"A"</tt>: upper alphabetics like A, B, C, ...</li>
212          * <li><tt>"i"</tt>: lower romans like i, ii, iii, ...</li>
213          * <li><tt>"I"</tt>: upper romans like I, II, III, ...</li>
214          * </ul>
215          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
216          * @since 1.0
217          * @javascript Re-compilers must resolve the member of this instance field to the
218          * identifier of the field name appending to the identifier resolved from its 
219          * qualifying member with a dot in between.
220          */
221         public final Value.String.Member type  = new Value.String.Member(this, Members.type );
222     }
223 
224     /**
225      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
226      * with the wrapping constructor.</p>
227      * @param var The argument of an <b>opaque</b> object.
228      * @since 1.0
229      * @javascript Re-compilers must ignore the construction operation of this constructor,
230      * that is, replacing it with its only argument.
231      */
232     public JsHTMLOListElement(JsObject var) {
233         super(var);
234     }
235 
236     /**
237      * <p>An <b>opaque</b> static field defining a member that is named by the field name
238      * without a qualifying member and to access the property of the name on an object.</p>
239      * <p>The property, identified by this member, of a {@link JsHTMLOListElement} 
240      * object refers to a boolean value specifying whether to reduce interitem spacing, 
241      * giving a hint to visual browsers to render the list in a more compact way.</p>
242      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
243      * @since 1.0
244      * @javascript Re-compilers must resolve the member of this static field to the
245      * identifier of the field name.
246      */
247     public static final Value.Boolean.Member compact = new Value.Boolean.Member(Members.compact);
248     /**
249      * <p>An <b>opaque</b> static field defining a member that is named by the field name
250      * without a qualifying member and to access the property of the name on an object.</p>
251      * <p>The property, identified by this member, of a {@link JsHTMLOListElement} 
252      * object refers to an integer value specifying the starting number of the first 
253      * item in an ordered list. The default starting number is "1". Note that while 
254      * the value of this attribute is an integer, the corresponding label may be 
255      * non-numeric. Thus, when the list item style is uppercase latin letters (A, B, C, ...), 
256      * the value 3 means "C". When the style is lowercase roman numerals, 3 means 
257      * "iii", etc.</p>
258      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
259      * @since 1.0
260      * @javascript Re-compilers must resolve the member of this static field to the
261      * identifier of the field name.
262      */
263     public static final Value.Number.Member start = new Value.Number.Member(Members.start);
264     /**
265      * <p>An <b>opaque</b> static field defining a member that is named by the field name
266      * without a qualifying member and to access the property of the name on an object.</p>
267      * <p>The property, identified by this member, of a {@link JsHTMLUListElement} 
268      * object refers to a string specifying the type of the ordered list. Possible 
269      * values for the type attribute are case-sensitive. The values and their meanings 
270      * are:
271      * <ul>
272      * <li><tt>"1"</tt>: arabic numbers like 1, 2, 3, ...</li>
273      * <li><tt>"a"</tt>: lower alphabetics like a, b, c, ...</li>
274      * <li><tt>"A"</tt>: upper alphabetics like A, B, C, ...</li>
275      * <li><tt>"i"</tt>: lower romans like i, ii, iii, ...</li>
276      * <li><tt>"I"</tt>: upper romans like I, II, III, ...</li>
277      * </ul>
278      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
279      * @since 1.0
280      * @javascript Re-compilers must resolve the member of this static field to the
281      * identifier of the field name.
282      */
283     public static final Value.String.Member type  = new Value.String.Member(Members.type );
284 
285     @Override
286     /**
287      * <p>Returns the primitive value associated with the current instance, if there is one.
288      * This invocation simply returns the instance itself for the current instance is an 
289      * object and there is no primitive value for it.</p>
290      * @return The current object itself.
291      * @since 1.0
292      * @javascript Re-compilers must convert the instance invocation of this method directly
293      * into a JavaScript invocation on its current object instance without changing the 
294      * method name, but expanding variable arguments, if any, into comma-separated values. 
295      */
296     public final JsHTMLOListElement valueOf() {
297         return new JsHTMLOListElement((JsObject)var().valueOf());
298     }
299 }