forked from paulvi/eclipse-node-ide
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathE4X.js2
More file actions
654 lines (573 loc) · 33.7 KB
/
E4X.js2
File metadata and controls
654 lines (573 loc) · 33.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
/**
* Determines whether the specified string is a valid name for an XML element or attribute.
* @param str - A string to evaluate.
* @return Returns true if the str argument is a valid XML name; false otherwise.
*/
package {
public native function isXMLName(str:String):Boolean
/**
* An XMLList object is an ordered collection of properties. An XMLList object represents an XML document, an XML fragment,
* or an arbitrary collection of XML objects.
* An XMLList object with one XML element is treated the same as an XML object. When there is one XML element, all methods
* that are available for the XML object are also available for the XMLList object.
*/
public final dynamic class XMLList extends XML {
/**
* Creates a new XMLList object.
* @param value - Any object that can be converted to an XMLList object by using the top-level XMLList() function.
* @constructor
*/
public native function XMLList(value:Object = null):XMLList
/**
* Calls the attribute() method of each XML object and returns an XMLList object of the results. The results match
* the given attributeName parameter. If there is no match, the attribute() method returns an empty XMLList object.
* @param attributeName The name of the attribute that you want to include in an XMLList object.
* @return
*/
public native function attribute(attributeName:*):XMLList
/**
* Calls the attributes() method of each XML object and returns an XMLList object of attributes for each XML object.
* @return An XMLList object of attributes for each XML object.
*/
public native function attributes():XMLList
/**
* Calls the child() method of each XML object and returns an XMLList object that contains the results in order.
* @param propertyName - The element name or integer of the XML child.
* @return An XMLList object of child nodes that match the input parameter.
*/
public native function child(propertyName:Object):XMLList
/**
* Calls the children() method of each XML object and returns an XMLList object that contains the results.
* @return An XMLList object of the children in the XML objects.
*/
public native function children():XMLList
/**
* Calls the comments() method of each XML object and returns an XMLList of comments.
* @return An XMLList of the comments in the XML objects.
*/
public native function comments():XMLList
/**
* Checks whether the XMLList object contains an XML object that is equal to the given value parameter.
* @param value - An XML object to compare against the current XMLList object.
* @return If the XMLList contains the XML object declared in the value parameter, then true; otherwise false.
*/
public native function contains(value:XML):Boolean
/**
* Returns a copy of the given XMLList object. The copy is a duplicate of the entire tree of nodes. The copied XML object has no parent
* and returns null if you attempt to call the parent() method.
* @return The copy of the XMLList object.
*/
public native function copy():XMLList
/**
* Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object that have the given name parameter.
* The name parameter can be a QName object, a String data type, or any other data type that is then converted to a String data type.
* To return all descendants, use the asterisk (*) parameter. If no parameter is passed, the string "*" is passed and returns all
* descendants of the XML object.
* @param name - The name of the element to match, defaults to *.
*/
public native function descendants(name:Object = *):XMLList
/**
* Calls the elements() method of each XML object. The name parameter is passed to the descendants() method. If no parameter is passed,
* the string "*" is passed to the descendants() method.
* @param name - the name of the elements to match, defaulting to *.
* @return An XMLList object of the matching child elements of the XML objects
*/
public native function elements(name:Object = *):XMLList
/**
* Checks whether the XMLList object contains complex content. An XMLList object is considered to contain complex content if it is not
* empty and either of the following conditions is true:
* The XMLList object contains a single XML item with complex content.
* The XMLList object contains elements.
* @return - If the XMLList object contains complex content, then true; otherwise false.
*/
public native function hasComplexContent():Boolean
/**
* Checks for the property specified by p.
* @param p The property to match.
* @return - If the parameter exists, then true; otherwise false.
*/
public native function hasOwnProperty (p:String):Boolean
/**
* Checks whether the XMLList object contains simple content. An XMLList object is considered to contain simple content if one or more
* of the following conditions is true:
* The XMLList object is empty
* The XMLList object contains a single XML item with simple content
* The XMLList object contains no elements
* @return - If the XMLList contains simple content, then true; otherwise false.
*/
public native function hasSimpleContent():Boolean
/**
* Returns the number of properties in the XMLList object.
* @return - If the parameter exists, then true; otherwise false.
*/
public native function length ():int
/**
* Merges adjacent text nodes and eliminates empty text nodes for each of the following: all text nodes in the XMLList, all the XML
* objects contained in the XMLList, and the descendants of all the XML objects in the XMLList.
* @return - The normalized XMLList object.
*/
public native function normalize():XMLList
/**
* Returns the parent of the XMLList object if all items in the XMLList object have the same parent. If the XMLList object has no parent
* or different parents, the method returns undefined.
* @return - Returns the parent XML object.
*/
public native function parent():XML
/**
* If a name parameter is provided, lists all the children of the XMLList object that contain processing instructions with that name.
* With no parameters, the method lists all the children of the XMLList object that contain any processing instructions.
* @param name The name of the processing instructions to match.
* @return - An XMLList object that contains the processing instructions for each XML object.
*/
public native function processingInstructions(name:String = "*"):XMLList
/**
* Calls the text() method of each XML object and returns an XMLList object that contains the results.
* @param name The name of the processing instructions to match.
* @return - An XMLList object of all XML properties of the XMLList object that represent XML text nodes.
*/
public native function text():XMLList
/**
* Returns a string representation of all the XML objects in an XMLList object. The rules for this conversion depend on whether the XML
* object has simple content or complex content:
* If the XML object has simple content, toString() returns the string contents of the XML object with the following stripped out: the
* start tag, attributes, namespace declarations, and end tag.
* If the XML object has complex content, toString() returns an XML encoded string representing the entire XML object, including the start
* tag, attributes, namespace declarations, and end tag.
* To return the entire XML object every time, use the toXMLString() method.
* @return - The string representation of the XML object.
*/
public native function toString():String
/**
* Returns a string representation of all the XML objects in an XMLList object. Unlike the toString() method, the toXMLString()
* method always returns the start tag, attributes, and end tag of the XML object, regardless of whether the XML object has simple content
* or complex content. (The toString() method strips out these items for XML objects that contain simple content.)
* @return - The string representation of the XML object.
*/
public native function toXMLString():String
public native function valueOf():XMLList;
}
/**
* The XML class contains methods and properties for working with XML objects. The XML class (along with the XMLList, Namespace, and
* QName classes) implements the powerful XML-handling standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2).
* Use the toXMLString() method to return a string representation of the XML object regardless of whether the XML object has simple content
* or complex content.
*/
public dynamic class XML {
/**
* Determines whether XML comments are ignored when XML objects parse the source XML data. By default, the comments are ignored (true).
* To include XML comments, set this property to false. The ignoreComments property is used only during the XML parsing, not during the call
* to any method such as myXMLObject.child(*).toXMLString(). If the source XML includes comment nodes, they are kept or discarded during the
* XML parsing.
*/
public static native function get ignoreComments():Boolean
public static native function set ignoreComments(value:Boolean):void
/**
* Determines whether XML processing instructions are ignored when XML objects parse the source XML data. By default, the processing
* instructions are ignored (true). To include XML processing instructions, set this property to false. The ignoreProcessingInstructions
* property is used only during the XML parsing, not during the call to any method such as myXMLObject.child(*).toXMLString(). If the
* source XML includes processing instructions nodes, they are kept or discarded during the XML parsing.
*/
public static native function get ignoreProcessingInstructions():Boolean
public static native function set ignoreProcessingInstructions(value:Boolean):void
/**
* Determines whether white space characters at the beginning and end of text nodes are ignored during parsing. By default, white space
* is ignored (true). If a text node is 100% white space and the ignoreWhitespace property is set to true, then the node is not created.
* To show white space in a text node, set the ignoreWhitespace property to false.
*/
public static native function get ignoreWhitespace():Boolean
public static native function set ignoreWhitespace(value:Boolean):void
/**
* Determines the amount of indentation applied by the toString() and toXMLString() methods when the XML.prettyPrinting property is set
* to true. Indentation is applied with the space character, not the tab character. The default value is 2.
*/
public static native function get prettyIndent():int
public static native function set prettyIndent(value:int):void
/**
* Determines whether the toString() and toXMLString() methods normalize white space characters between some tags. The default value is true.
*/
public static native function get prettyPrinting():Boolean
public static native function set prettyPrinting(value:Boolean):void
/**
* Creates a new XML object. You must use the constructor to create an XML object before you call any of the methods of the XML class.
* Use the toXMLString() method to return a string representation of the XML object regardless of whether the XML object has simple
* content or complex content.
* @param value
* @constructor
*/
public native function XML(value:Object = null):XML;
/**
* Adds a namespace to the set of in-scope namespaces for the XML object. If the namespace already exists in the in-scope namespaces
* for the XML object (with a prefix matching that of the given parameter), then the prefix of the existing namespace is set to undefined.
* If the input parameter is a Namespace object, it's used directly. If it's a QName object, the input parameter's URI is used to create
* a new namespace; otherwise, it's converted to a String and a namespace is created from the String.
* @param The namespace to add to the XML object.
* @return The new XML object, with the namespace added.
*/
public native function addNamespace(ns:Object):XML
/**
* Appends the given child to the end of the XML object's properties. The appendChild() method takes an XML object, an XMLList object,
* or any other data type that is then converted to a String.
* Use the delete (XML) operator to remove XML nodes.
* @param The XML object to append.
* @return The resulting XML object.
*/
public native function appendChild(ns:Object):XML
/**
* Returns the XML value of the attribute that has the name matching the attributeName parameter. Attributes are found within XML
* elements. In the following example, the element has an attribute named "gender" with the value "boy": <first gender="boy">John</first>.
* The attributeName parameter can be any data type; however, String is the most common data type to use. When passing any object other
* than a QName object, the attributeName parameter uses the toString() method to convert the parameter to a string.
* If you need a qualified name reference, you can pass in a QName object. A QName object defines a namespace and the local name, which
* you can use to define the qualified name of an attribute. Therefore calling attribute(qname) is not the same as calling
* attribute(qname.toString()).
* @param attributeName The name of the attribute.
* @return An XMLList object or an empty XMLList object. Returns an empty XMLList object when an attribute value has not been defined.
*/
public native function attribute(attributeName:*):XMLList
/**
* Returns a list of attribute values for the given XML object. Use the name() method with the attributes() method to return the name
* of an attribute. Use @* to return the names of all attributes.
* @return The list of attribute values.
*/
public native function attributes():XMLList
/**
* Lists the children of an XML object. An XML child is an XML element, text node, comment, or processing instruction.
* Use the propertyName parameter to list the contents of a specific XML child. For example, to return the contents of a child named
* <first>, use child.name("first"). You can generate the same result by using the child's index number. The index number identifies
* the child's position in the list of other XML children. For example, name.child(0) returns the first child in a list.
* Use an asterisk (*) to output all the children in an XML document. For example, doc.child("*").
* Use the length() method with the asterisk (*) parameter of the child() method to output the total number of children. For example,
* numChildren = doc.child("*").length().
* @param propertyName - The element name or integer of the XML child.
* @return An XMLList object of child nodes that match the input parameter.
*/
public native function child(propertyName:Object):XMLList
/**
* Identifies the zero-indexed position of this XML object within the context of its parent.
* @return The position of the object. Returns -1 as well as positive integers.
*/
public native function childIndex():int
/**
* Lists the children of the XML object in the sequence in which they appear. An XML child is an XML element, text node, comment,
* or processing instruction.
* @return An XMLList object of the XML object's children.
*/
public native function children():XMLList
/**
* Lists the properties of the XML object that contain XML comments.
* @return An XMLList object of the properties that contain comments.
*/
public native function comments():XMLList
/**
* Compares the XML object against the given value parameter.
* @param value - A value to compare against the current XML object.
* @return If the XML object matches the value parameter, then true; otherwise false.
*/
public native function contains(value:XML):Boolean
/**
* Returns a copy of the given XML object. The copy is a duplicate of the entire tree of nodes. The copied XML object has no parent and
* returns null if you attempt to call the parent() method.
* @return The copy of the object.
*/
public native function copy():XML
/**
* Returns an object with the following properties set to the default values: ignoreComments, ignoreProcessingInstructions,
* ignoreWhitespace, prettyIndent, and prettyPrinting.
*/
public native static function defaultSettings():Object
/**
* Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object that have the given name
* parameter. The name parameter is optional. The name parameter can be a QName object, a String data type or any other data type that is
* then converted to a String data type. To return all descendants, use the "*" parameter. If no parameter is passed, the string "*" is
* passed and returns all descendants of the XML object.
* @param name The name of the element to match.
* @return An XMLList object of matching descendants. If there are no descendants, returns an empty XMLList object.
*/
public native function descendants(name:Object = "*"):XMLList
/**
* Lists the elements of an XML object. An element consists of a start and an end tag; for example <first></first>. The name parameter
* is optional. The name parameter can be a QName object, a String data type, or any other data type that is then converted to a String
* data type. Use the name parameter to list a specific element. For example, the element "first" returns "John" in this example:
* <first>John</first>.
* To list all elements, use the asterisk (*) as the parameter. The asterisk is also the default parameter. Use the length() method with
* the asterisk parameter to output the total number of elements. For example, numElement = addressbook.elements("*").length().
* @param name - The name of the element. An element's name is surrounded by angle brackets. For example, "first" is the name
* in this example: <first></first>.
* @return An XMLList object of the element's content. The element's content falls between the start and end tags. If you use the
* asterisk (*) to call all elements, both the element's tags and content are returned.
*/
public native function elements(name:Object = "*"):XMLList
/**
* Checks to see whether the XML object contains complex content. An XML object contains complex content if it has child elements. XML
* objects that representing attributes, comments, processing instructions, and text nodes do not have complex content. However, an object
* that contains these can still be considered to contain complex content (if the object has child elements).
* @return If the XML object contains complex content, true; otherwise false.
*/
public native function hasComplexContent():Boolean
/**
* Checks to see whether the XML object contains simple content. An XML object contains simple content if it represents a text node, an
* attribute node, or an XML element that has no child elements. XML objects that represent comments and processing instructions do not
* contain simple content.
* @return If the XML object contains simple content, true; otherwise false.
*/
public native function hasSimpleContent():Boolean
/**
* Lists the namespaces for the XML object, based on the object's parent.
* @return An array of Namespace objects
*/
[ArrayElementType("Namespace")]
public native function inScopeNamespaces():Array
/**
* Inserts the given child2 parameter after the child1 parameter in this XML object and returns the resulting object. If the child1
* parameter is null, the method inserts the contents of child2 before all children of the XML object (in other words, after none).
* If child1 is provided, but it does not exist in the XML object, the XML object is not modified and undefined is returned.
* If you call this method on an XML child that is not an element (text, attributes, comments, pi, and so on) undefined is returned.
* Use the delete (XML) operator to remove XML nodes.
* @param child1 - The object in the source object that you insert before child2.
* @param child2 - The object to insert.
* @return The resulting XML object or undefined.
*/
public native function insertChildAfter(child1:Object, child2:Object):*
/**
* Inserts the given child2 parameter before the child1 parameter in this XML object and returns the resulting object. If the child1
* parameter is null, the method inserts the contents of child2 after all children of the XML object (in other words, before none).
* If child1 is provided, but it does not exist in the XML object, the XML object is not modified and undefined is returned.
* If you call this method on an XML child that is not an element (text, attributes, comments, pi, and so on) undefined is returned.
* Use the delete (XML) operator to remove XML nodes.
* @param child1 - The object in the source object that you insert after child2.
* @param child2 - The object to insert.
* @return The resulting XML object or undefined.
*/
public native function insertChildBefore(child1:Object, child2:Object):*
/**
* For XML objects, this method always returns the integer 1. The length() method of the XMLList class returns a value of 1 for an
* XMLList object that contains only one value.
* @return Always returns 1 for any XML object.
*/
public native function length():int
/**
* Gives the local name portion of the qualified name of the XML object.
* @return The local name as either a String or null.
*/
public native function localName():Object
/**
* Gives the qualified name for the XML object.
* @return The qualified name is either a QName or null.
*/
public native function name():Object
/**
* If no parameter is provided, gives the namespace associated with the qualified name of this XML object. If a prefix parameter is
* specified, the method returns the namespace that matches the prefix parameter and that is in scope for the XML object.
* If there is no such namespace, the method returns undefined.
* @param prefix The prefix you want to match, defaults to null.
* @return The qualified name is either a QName or null.
*/
public native function namespace(prefix:String = null):Object
/**
* Lists namespace declarations associated with the XML object in the context of its parent.
* @return An array of Namespace objects.
*/
public native function namespaceDeclarations():/*Namespace*/ Array
/**
* Specifies the type of node: text, comment, processing-instruction, attribute, or element.
* @return The node type used.
*/
public native function nodeKind():String
/**
* For the XML object and all descendant XML objects, merges adjacent text nodes and eliminates empty text nodes.
* @return The resulting normalized XML object.
*/
public native function normalize():XML
/**
* Returns the parent of the XML object. If the XML object has no parent, the method returns undefined.
* @return The parent XML object. Returns either a String or undefined.
*/
public native function parent():*
/**
* Inserts a copy of the provided child object into the XML element before any existing XML properties for that element. Use the
* delete (XML) operator to remove XML nodes.
* @param value - The object to insert.
* @return The resulting XML object.
*/
public native function prependChild(value:Object):XML
/**
* If a name parameter is provided, lists all the children of the XML object that contain processing instructions with that name.
* With no parameters, the method lists all the children of the XML object that contain any processing instructions.
* @param The name of the processing instructions to match, defaulting to "*".
* @return A list of matching child objects.
*/
public native function processingInstructions(name:String = "*"):XMLList
/**
* Removes the given namespace for this object and all descendants. The removeNamespaces() method does not remove a namespace if it is
* referenced by the object's qualified name or the qualified name of the object's attributes.
* @param ns - The namespace to remove.
* @return A copy of the resulting XML object.
*/
public native function removeNamespace(ns:Namespace):XML
/**
* Replaces the properties specified by the propertyName parameter with the given value parameter. If no properties match propertyName,
* the XML object is left unmodified.
* @param propertyName - Can be a numeric value, an unqualified name for a set of XML elements, a qualified name for a set of XML elements,
* or the asterisk wildcard ("*"). Use an unqualified name to identify XML elements in the default namespace.
* @param value - The replacement value. This can be an XML object, an XMLList object, or any value that can be converted with toString().
* @return The resulting XML object, with the matching properties replaced.
*/
public native function replace(propertyName:*, value:*):XML
/**
* Replaces the child properties of the XML object with the specified set of XML properties, provided in the value parameter.
* @param value - The replacement XML properties. Can be a single XML object or an XMLList object.
* @return The resulting XML object.
*/
public native function setChildren(value:Object):XML
/**
* Changes the local name of the XML object to the given name parameter.
* @param name - The replacement name for the local name.
*/
public native function setLocalName(name:String):void
/**
* Sets the name of the XML object to the given qualified name or attribute name.
* @param name - The new name for the object.
*/
public native function setName(name:String):void
/**
* Sets the namespace associated with the XML object.
* @param ns - The new namespace.
*/
public native function setNamespace(name:String):void
/**
* Sets values for the following XML properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting.
* @param rest An object with each of the following properties:
* ignoreComments
* ignoreProcessingInstructions
* ignoreWhitespace
* prettyIndent
* prettyPrinting
*/
public native static function setSettings(... rest):void
/**
* Retrieves the following properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting.
* @return An object with the following XML properties:
* ignoreComments
* ignoreProcessingInstructions
* ignoreWhitespace
* prettyIndent
* prettyPrinting
*/
public native static function settings():Object
/**
* Returns an XMLList object of all XML properties of the XML object that represent XML text nodes.
* @return The list of properties.
*/
public native function text():XMLList
/**
* Returns a string representation of the XML object. The rules for this conversion depend on whether the XML object has simple content
* or complex content:
* If the XML object has simple content, toString() returns the String contents of the XML object with the following stripped out:
the start tag, attributes, namespace declarations, and end tag.
* If the XML object has complex content, toString() returns an XML encoded String representing the entire XML object, including
the start tag, attributes, namespace declarations, and end tag.
* To return the entire XML object every time, use toXMLString().
* @return The string representation of the XML object.
*/
public native function toString():String
/**
* Returns a string representation of the XML object. Unlike the toString() method, the toXMLString() method always returns the start
* tag, attributes, and end tag of the XML object, regardless of whether the XML object has simple content or complex content.
* (The toString() method strips out these items for XML objects that contain simple content.)
* @return The string representation of the XML object.
*/
public native function toXMLString():String
public native function valueOf():XML;
}
/**
* The Namespace class contains methods and properties for defining and working with namespaces. There are three scenarios for using namespaces:<ul>
* <li>Namespaces of XML objects Namespaces associate a namespace prefix with a Uniform Resource Identifier (URI) that identifies the namespace.
* The prefix is a string used to reference the namespace within an XML object. If the prefix is undefined, when the XML is converted to a
* string, a prefix is automatically generated.</li>
* <li> Namespace to differentiate methods Namespaces can differentiate methods with the same name to perform different tasks. If two methods
* have the same name but separate namespaces, they can perform different tasks.</li>
* <li>Namespaces for access control Namespaces can be used to control access to a group of properties and methods in a class. If you place
* the properties and methods into a private namespace, they are inaccessible to any code that does not have access to that namespace.
* You can grant access to the group of properties and methods by passing the namespace to other classes, methods or functions.</li>
*</ul>
* This class shows two forms of the constructor method because each form accepts different parameters.
*/
public final class Namespace {
/**
* The prefix of the namespace.
*/
public native function get prefix():String
public native function set prefix(value:String):void
/**
* The Uniform Resource Identifier (URI) of the namespace.
*/
public native function get uri():String
public native function set uri(value:String):void
/**
* Creates a Namespace object according to the values of the prefixValue and uriValue parameters. This constructor requires both parameters.
* The value of the prefixValue parameter is assigned to the prefix property as follows:<ul>
* <li>If undefined is passed, prefix is set to undefined.</li>
* <li>If the value is a valid XML name, as determined by the isXMLName() function, it is converted to a string and assigned to the prefix property.</li>
* <li>If the value is not a valid XML name, the prefix property is set to undefined.</li>
* </ul>
* The value of the uriValue parameter is assigned to the uri property as follows:
* If a QName object is passed, the uri property is set to the value of the QName object's uri property.
* If the value is a Namespace object (and first parameter is not specified), a copy of the object is created.
* Otherwise, the uriValue parameter is converted to a string and assigned to the uri property.
* If no values is passed, the prefix and uri properties are set to an empty string.
* @param prefixValue - The prefix to use for the namespace.
* @param uriValue - The Uniform Resource Identifier (URI) of the namespace.
* @constructor
*/
public native function Namespace(prefixValue:* = undefined, uriValue:* = undefined);
public native function valueOf():Namespace;
/**
* Equivalent to the Namespace.uri property.
* @return The Uniform Resource Identifier (URI) of the namespace, as a string.
*/
public native function toString():String
}
/**
* QName objects represent qualified names of XML elements and attributes. Each QName object has a local name and a namespace
* Uniform Resource Identifier (URI). When the value of the namespace URI is null, the QName object matches any namespace. Use the QName
* constructor to create a new QName object that is either a copy of another QName object or a new QName object with a uri from a Namespace
* object and a localName from a QName object.
*/
public final dynamic class QName {
/**
* The local name of the QName object.
*/
public native function get localName():String
/**
* The Uniform Resource Identifier (URI) of the QName object.
*/
public native function get uri():String
/**
* Creates a QName object with a URI object from a Namespace object and a localName from a QName object. If either parameter is not the
* expected data type, the parameter is converted to a string and assigned to the corresponding property of the new QName object.
* For example, if both parameters are strings, a new QName object is returned with a uri property set to the first parameter and a
* localName property set to the second parameter. In other words, the following permutations, along with many others, are valid forms of
* the constructor:
* QName (uri:Namespace, localName:String);
* QName (uri:String, localName: QName);
* QName (uri:String, localName: String);
* If you pass null for the uri parameter, the uri property of the new QName object is set to null.
* When uri is not passed then creates a QName object that is a copy of another QName object. If the parameter passed to the constructor
* is a QName object, a copy of the QName object is created. If the parameter is not a QName object, the parameter is converted to a
* string and assigned to the localName property of the new QName instance. If the parameter is undefined or unspecified, a new QName
* object is created with the localName property set to the empty string.
* @param uri A Namespace object from which to copy the uri value. A parameter of any other type is converted to a string.
* @param localName The QName object to be copied (when uri is not passed). Objects of any other type are converted to a string that is
* assigned to the localName property of the new QName object.
* When uri passed - A QName object from which to copy the localName value. A parameter of any other type is converted to a string.
*/
public native function QName(uri:* = null, localName:* = null);
public native function toString():String
}
/**
* A Class object is created for each class definition in a program. Every Class object is an instance of the Class class. The Class object
* contains the static properties and methods of the class. The class object creates instances of the class when invoked using the new
* operator.
*/
public dynamic class Class extends Object {}
}