Skip to end of metadata
Go to start of metadata

Overview

This page describes the valid elements, attributes, and attribute values for the XML-based content assist of JavaScript libraries.

Introduction

The metadata in SDOCML files helps to provide the Code Assist information for the JavaScript editor. This reference describes which elements, attributes, and attribute values are valid metadata.

The section for each element includes the following information:

  • Short description of the element
  • Syntax
  • Element parents and children
  • Element attributes and their valid values
  • Longer explanation of the element
  • Example(s)

Once you have created this file, see Using JavaScript Libraries for the specifics on how to use it. Check the Aptana Log file (Help Menu > Troubleshooting > Aptana Log File) to see if there are any errors generated when loading it. There is also an available XSD to validate your document.

Short Example

This example is not meant to be exhaustive, but will give you an example of what a simple file looks like.

Types

We support an optional notation when describing types:

Arrays

  • String[] - Array of Strings (simple syntax)
  • Array<String> - Array of Strings (generics syntax for above)
  • Array<Array<String>> - Array of Array of Strings

Functions

  • Function - function with no params, and no return value
  • Function:Object - function with no params, returns an Object
  • Function->Object - function with no params, returns an Object (alternate syntax for above)
  • Function:(String | Number) - function with no params, returns String or Number
  • Function(String, Number) - function with two params, first of type String, second of type Number, and no return value

A ScriptDoc sample

A XML sample

Reference

alias

Alternate name for a class.

Syntax

Child of: #aliases

No children.

Attributes and values

  • name - Name of the alias
  • type - Type that the alias represents

Description

The alias element is used in special cases to make Code Assist appear properly for a class.

Example

aliases

Container node for the alternate name(s) for a class.

Syntax

Child of: #class

Parent of: #alias

Attributes and values

No attributes and values.

Description

The alias element is used in special cases to make Code Assist appear properly for a class.

Example

availability

Container node for the specifications (e.g. ECMAScript version) that apply to a class, constructor, method, or property.

Syntax

Child of: #class, #constructor, #method, #property

Parent of: #specification

Attributes and values

No attributes and values.

Description

The availability element element lists the specifications (e.g. JavaScript version, JScript version and/or ECMAScript version) that apply to a class, constructor, method, or property.

In the DOM, CSS, HTML metadata, the availability and specification nodes hold information about the W3C specification for an element or object.

Example

browser

Holds the information about browser support for a class, constructor, method, or property.

Syntax

Child of: #browsers

Parent of: #description

Attributes and values

  • platform - Name of the browser platform. Use "IE", "Mozilla", "Netscape", "Opera", or "Safari".
  • version - Platform version (optional but recommended)
  • os - Operating system (optional)
  • osVersion - OS version

Description

The browser element lists the browser support information that applies to a class, constructor, method, or property.

Use the child description node to list any caveats or notes about the browser support for that particular class, constructor, method, or property.

Example

browsers

Container node that holds browser nodes, which have the information about browser support for a class, constructor, method, or property.

Syntax

Child of: #class, #constructor, #method, #property

Parent of: #browser

Attributes and values

No attributes or values.

Description

The browsers element holds the browser nodes for a class, constructor, property, or method.

Example

class

Represents an object class in JavaScript.

Syntax

Child of: #javascript

Parent of: #aliases, #availability, #browsers, #constructors, #deprecated, #description, #example, #interfaces, #methods, #mixins, #properties, #references, #remarks

Attributes and values

  • type - JavaScript type or object type of the class (e.g. Boolean, Document, etc.)
  • superclass - Superclass that the class belongs to. Separate multiple superclasses with a space
  • visibility - If internal only, specify "internal", otherwise, leave blank.

Description

The class element is the container node for a JavaScript class.

Example

constructor

Holds constructor information for a class.

In JS, functions can serve as standard functions and they can be used to construct new object instances. Typically, when defining types in SDOCML files, the instances cannot be constructed directly. However, there are occasions where a constructor method for a type is needed. That's where the constructor element steps in.

When a constructor element is encountered, a new global property matching the type name is created. It's return type is setup to Function<type> where "type" is the name of the type where the constructor element is defined.

Syntax

Child of: #constructors

Parent of: #availability, #browsers, #description, #example, #exceptions, #parameters, #references, #return-description, #return-types, #remarks

Attributes and values

  • scope - Instance or static.
  • visibility - If internal only, specify "internal". Otherwise, leave blank. (Optional.)

Description

The constructors element holds the constructor node(s) for a class.

Example

constructors

Container node that holds constructor node(s) for a class.

Syntax

Child of: #class

Parent of: #constructor

Attributes and values

No attributes or values.

Description

The constructors element holds the constructor node(s) for a class.

Example

deprecated

If present, indicates that a class, constructor, method, or property is deprecated.

Syntax

Child of: #class, #constructor, #method, #property

No children.

Attributes and values

No attributes or values.

Description

If present, the deprecated element indicates that a class, constructor, method, or property has been deprecated. The node text describes the replacement class, constructor, method, or property.

Example

description

Contains the text description of a browser support node, class, constructor, method, parameter, or property.

Syntax

Child of: #browser, #class, #constructor, #method, #parameter, #property

No children.

Attributes and values

No attributes or values.

Description

Contains the text description of a browser support node, class, constructor, method, parameter, or property. For browser support, the description contains notes and caveats about the browser support for a class, constructor, method or property.

Example

example

Contains an example of how to use a class, constructor, method, or property.

Syntax

Child of: #class, #constructor, #method, #property

No children.

Attributes and values

No attributes or values.

Description

Contains the text description of a code sample. Also contains the code sample itself. Because examples are rendered as HTML, actual code formatting should use HTML entities and escape characters so that they display properly.

Example

exception

Contains exception information for a method.

Syntax

Child of: #exceptions

Parent of: #description

Attributes and values

  • type - Name of the error type (e.g. "DOMException")

Description

The exception element holds the error type and description information for an exception that can be thrown for a method.

Example

exceptions

Container node for the exception(s) for a method.

Syntax

Child of: #method

Parent of: #exception

Attributes and values

  • type - Name of the error type (e.g. "DOMException")

Description

The exceptions element is a container node for the individual exception elements for a method.

Example

interface

Contains interface information for a class.

Syntax

Child of: #interfaces

No children

Attributes and values

  • type - Name of interface type

Description

Contains interface information for a class. Used primarily for global classes.

Example

interfaces

Container node for the interface node for a class.

Syntax

Child of: #class

Parent of: #interface

Attributes and values

No attributes and values.

Description

Contains the interface node for a class. Used primarily for global classes.

Example

javascript

Overall parent node to all of the individual class nodes of the JavaScript metadata.

Syntax

No parent.

Parent of: #class

Attributes and values

No attributes and values.

Description

Overall parent node to all of the individual class nodes of the JavaScript metadata.

Example

method

Contains information about a class method.

Syntax

Child of: #methods

Parent of: #availability, #browsers, #deprecated, #description, #example, #exceptions, #parameters, #references, #remarks, #return-description, #return-types

Attributes and values

  • name - Name of the method
  • scope - instance or static

Description

The method element holds the description of a method.

Example

methods

Container node for the method node(s) of a class.

Syntax

Child of: #class

Parent of: #method

Attributes and values

No attributes or values.

Description

The methods element holds the individual method nodes for a class.

Example

mixin

Contains information about the properties and methods "mixed-in" to the parent class.

Syntax

Child of: #mixins

Parent of: #mixin

Attributes and values

  • type -Type of the class
  • scope - instance or static

Description

The mixin element indicates what properties and methods of a class will be "mixed-in". In the example below, the static methods and properties of Class1 and Class2 will be available as instance properties and methods on the parent class holding this mixins node. The case of mixins scope="instance", mixin scope="instance" is effectively regular inheritance, so while possible to specify using this interface, using the regular superclass attribute is preferred.

Example

mixins

Container node for the mixin node(s) of a class. There may be multiple "mixins" nodes. These nodes indicate what types of items to "mix-in" from the referenced classes

Syntax

Child of: #class

Parent of: #mixin

Attributes and values

No attributes or values.

Description

The mixins element holds the individual mixin nodes for a class.

Example

parameter

Holds parameter information for a method or constructor.

Syntax

Child of: #parameters

Parent of: #description, #values

Attributes and values

  • name - Name of the parameter.
  • type - JavaScript type of the parameter (e.g. Object).
  • usage - Whether the parameter is "required", "optional", or can take "one-or-more" values.

Description

The parameter element holds information about a parameter for a method.

Example

parameters

Container node for the individual parameter element(s) for a method.

Syntax

Child of: #method

Parent of: #parameter

Attributes and values

No attributes or values.

Description

The parameters element is a container for the individual parameter(s) for a method.

Example

properties

Container node for the individual properties for a class.

Syntax

Child of: #class

Parent of: #property

Attributes and values

No attributes or values.

Description

Container node for the individual properties for a class.

Example

property

Container node for the individual properties for a class.

Syntax

Child of: #properties

Parent of: #availability, #browsers, #deprecated, #description, #example, #remarks

Attributes and values

  • name - Property name.
  • type - JavaScript type (e.g. Object).
  • scope - static or instance.
  • access - read or read-write.
  • visibility - internal or blank.

Description
Contains the information for an individual property for a class.

Example

reference

Holds a reference to another class, property, or method.

Syntax

Child of: #references

No children.

Attributes and values

  • name - Name of the reference.

Description

Reference to a related class, property, or method.

Example

references

Container node for reference(s) for a class, property, or method.

Syntax

Child of: #class, #property, #method

Parent of: #reference

Attributes and values

No attributes or values.

Description

Container node for reference(s) for a class, property, or method. In the online Help, creates an automatic link to the reference.

Example

remarks

Contains text remarks about a class, constructor, method or property.

Syntax

Child of: #class, #constructor, #method, #property

No children.

Attributes and values

No attributes or values.
Description

Contains text remarks about a class, constructor, method, or property. Remarks are generally longer and give additional information to the sibling description node. Remarks are rendered in HTML and can contain HTML entities and escape characters for formatting.

Example

return-description

Contains a text description of the return type for a method.

Syntax

Child of: #method

No children.

Attributes and values

No attributes or values.

Description

Contains a text description of the return type for a method.

Example

return-type

Contains the JavaScript return type for a method.

Syntax

Child of: #return-types

No children.

Attributes and values

  • type - JavaScript type returned by the method.

Description

Contains the JavaScript return type for a method.

Example

return-types

Container node for the return-type node(s) for a method.

Syntax

Child of: #method

Parent of: #return-type

Attributes and values

No attributes or values.

Description

Container node for the return-type node(s) for a method. A JavaScript method may have more than one return type.

Example

specification

The specifications (e.g. ECMAScript version) that apply to a class, constructor, method, or property.

Syntax

Child of: #specification

No children.

Attributes and values

  • name - Name of the specification
  • version - Version of the specification (optional)

Description

The specification element(s) lists the specifications (e.g. JavaScript version, JScript version and/or ECMAScript version) that apply to a class, constructor, method, or property.

In the DOM, CSS, HTML metadata, the availability and specification nodes hold information about the W3C specification for an element or object.

Example

type-map

An element that specifies the mapping of one type to another.

Syntax

Child of: #type-maps

Parent of: none

Attributes and values

  • sourceType - The name of the type to map to the destination type
  • destinationType - The new type value to use when replacing the source type

type-maps

A container for all type-map elements.

Syntax

Child of: #javascript

Parent of: #type-map

Attributes and values

No attributes or values.

value

Contains a possible value for a parameter to a method.

Syntax

Child of: #parameter

No children.

Attributes and values

  • name - Name of the attribute.
  • description - Attribute description.

Description

Contains a valid value for an attribute for a parameter for a method.

Example

values

Container node for the individual value nodes for a parameter.

Syntax

Child of: #parameter

Parent of: #value

Attributes and values

No attributes or values.

Description

Container node for the individual value nodes for a parameter.

Example

  • No labels