jangaroo-runtime.2.0.19.source-code.Namespace.as Maven / Gradle / Ivy
package {
/**
* The Namespace class contains methods and properties for defining and working with namespaces. There are three scenarios for using namespaces:
*
* - 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.
* - 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.
* - 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.
* This class shows two forms of the constructor method because each form accepts different parameters.
* This class (along with the XML, XMLList, and QName classes) implements powerful XML-handling standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2).
*
* More examples
*
* Learn more
*
* Related API Elements
*
*/
[Native]
public final class Namespace {
/**
* The prefix of the namespace.
*/
public native function get prefix():String;
/**
* @private
*/
public native function set prefix(value:String):void;
/**
* The Uniform Resource Identifier (URI) of the namespace.
*/
public native function get uri():String;
/**
* @private
*/
public native function set uri(value:String):void;
/**
* Creates a Namespace object. The values assigned to the uri
and prefix
properties of the new Namespace object depend on the type of value passed for the uriValue
parameter:
*
* - If no value is passed, the
prefix
and uri
properties are set to an empty string.
* - If the value is a Namespace object, a copy of the object is created.
* - If the value is a QName object, the
uri
property is set to the uri
property of the QName object.
* Note: This class shows two constructor entries because each form accepts different parameters. The constructor behaves differently depending on the type and number of parameters passed, as detailed in each entry. ActionScript 3.0 does not support method or constructor overloading.
*
* 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:
*
* - If
undefined
is passed, prefix
is set to undefined
.
* - 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.
* - If the value is not a valid XML name, the
prefix
property is set to undefined
.
* 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.
* - Otherwise, the
uriValue
parameter is converted to a string and assigned to the uri
property.
* Note: This class shows two constructor method entries because each form accepts different parameters. The constructor behaves differently depending on the type and number of arguments passed, as detailed in each entry. ActionScript 3.0 does not support method or constructor overloading.
* @param prefixValue The prefix to use for the namespace.
* @param uriValue The Uniform Resource Identifier (URI) of the namespace.
*
*/
public function Namespace(prefixValue:*, uriValue:*) {
}
/**
* Equivalent to the Namespace.uri
property.
* @return The Uniform Resource Identifier (URI) of the namespace, as a string.
*
*/
public native function toString():String;
/**
* Returns the URI value of the specified object.
* @return The Uniform Resource Identifier (URI) of the namespace, as a string.
*
*/
public native function valueOf():String;
}
}