(class)
| constructor
public
| {ComponentMetaData.default frozen?:bool = false, copy-from:#ComponentMetaData = null, from-string:#String = null, deep-copy?:bool = false, ... } |
| author: | The name of the author of this component. |
accessor public sealed ComponentMetaData.author:#
String setter public sealed ComponentMetaData.author:#
String
| cache-duration: | Amount of time component may be cached without doing out-of-date checks. |
accessor public sealed ComponentMetaData.cache-duration:
Time setter public sealed ComponentMetaData.cache-duration:
Time
accessor public sealed inline ComponentMetaData.compilation-time:#
DateTimeData setter public sealed ComponentMetaData.compilation-time:#
DateTimeData
accessor public sealed inline ComponentMetaData.component-type:#
String setter public sealed ComponentMetaData.component-type:#
String
| content-id: | A unique, secure content-identifier for the component. |
accessor public sealed inline ComponentMetaData.content-id:#
ComponentID setter public sealed ComponentMetaData.content-id:#
ComponentID
accessor public sealed inline ComponentMetaData.content-size:
int setter public sealed ComponentMetaData.content-size:
int
accessor public sealed ComponentMetaData.copyright:#
String setter public sealed ComponentMetaData.copyright:#
String
| curl-api-version: | The API version from the curl herald used to compile component. |
accessor public sealed inline ComponentMetaData.curl-api-version:#
VersionNumber setter public sealed ComponentMetaData.curl-api-version:#
VersionNumber
| curl-versions: | List of Curl versions in which the component may be used. |
accessor public sealed ComponentMetaData.curl-versions:#{
ReadOnlyArray-of VersionNumber}
setter public sealed ComponentMetaData.curl-versions:#{
ReadOnlyArray-of VersionNumber}
| debuggable?: | Indicates whether component is debuggable. Defaults to false. |
accessor public sealed inline ComponentMetaData.debuggable?:
bool setter public sealed ComponentMetaData.debuggable?:
bool
accessor public sealed ComponentMetaData.default-locale:#
String setter public sealed ComponentMetaData.default-locale:#
String
| file: | Abstract file name of a resource. |
accessor public sealed ComponentMetaData.file:#
String setter public sealed ComponentMetaData.file:#
String
accessor public sealed inline ComponentMetaData.file-format:#
String setter public sealed ComponentMetaData.file-format:#
String
| files: | List of filenames included in the component. |
| frozen?: | Indicates if object is "frozen". |
field public-get hidden-set ComponentMetaData.frozen?:
bool
| id: | The unique identifier for the component. |
accessor public sealed inline ComponentMetaData.id:#
ComponentID
| jit-compilable?: | Indicates whether component may be JIT-compiled. Defaults to true. |
accessor public sealed inline ComponentMetaData.jit-compilable?:
bool setter public sealed ComponentMetaData.jit-compilable?:
bool
| jit-compiled?: | Indicates whether component was JIT-compiled. Defaults to true. |
accessor public sealed inline ComponentMetaData.jit-compiled?:
bool setter public sealed ComponentMetaData.jit-compiled?:
bool
accessor public sealed ComponentMetaData.license:#
String setter public sealed ComponentMetaData.license:#
String
| locale: | Identifies the locale of the component. |
accessor public sealed ComponentMetaData.locale:#
String setter public sealed ComponentMetaData.locale:#
String
| manifest: | The location of the manifest associated with this component. |
accessor public sealed ComponentMetaData.manifest:#
String setter public sealed ComponentMetaData.manifest:#
String
| name: | The name of the component. |
accessor public sealed inline ComponentMetaData.name:#
String setter public sealed ComponentMetaData.name:#
String
accessor public sealed ComponentMetaData.package-caching-style:#
String setter public sealed ComponentMetaData.package-caching-style:#
String
accessor public sealed ComponentMetaData.release-notes:#
String setter public sealed ComponentMetaData.release-notes:#
String
accessor public sealed ComponentMetaData.release-timestamp:#
DateTimeData setter public sealed ComponentMetaData.release-timestamp:#
DateTimeData
accessor public final ComponentMetaData.requires-privilege?:
bool setter public final ComponentMetaData.requires-privilege?:
bool
accessor public sealed ComponentMetaData.resource-directory:#
String setter public sealed ComponentMetaData.resource-directory:#
String
accessor public sealed ComponentMetaData.resync-as-of:#
DateTimeData setter public sealed ComponentMetaData.resync-as-of:#
DateTimeData
accessor public sealed ComponentMetaData.SHA-1-digest:#
SHA-1-Digest setter public sealed ComponentMetaData.SHA-1-digest:#
SHA-1-Digest
accessor public final ComponentMetaData.source-url:#
Url
| source-url-name: | A string containing the absolute Url of the source from which the component is compiled. |
accessor public sealed ComponentMetaData.source-url-name:#
String setter public sealed ComponentMetaData.source-url-name:#
String
| transitive-id: | A unique id for the component that includes dependencies. |
accessor public sealed inline ComponentMetaData.transitive-id:#
ComponentID setter public sealed ComponentMetaData.transitive-id:#
ComponentID
accessor public sealed ComponentMetaData.translations-file:#
String setter public sealed ComponentMetaData.translations-file:#
String
| version: | The version of the component. |
accessor public sealed inline ComponentMetaData.version:#
VersionNumber
|
public
| {ComponentMetaData.supported-value-type? type:Type}:bool |
|
public sealed
| {ComponentMetaData.assert-match component:Component}:void |
|
protected final
| {ComponentMetaData.assert-not-frozen}:void |
| clone: | Returns copy of object. |
| freeze: | Freeze the meta-data so that it cannot be changed. |
|
public sealed inline
| {ComponentMetaData.freeze}:void |
| get: | Get meta-data value for given key. |
|
public sealed
| {ComponentMetaData.get key:String}:any |
|
public sealed
| {ComponentMetaData.get-if-exists key:String }:(value:any, found?:bool) |
|
public sealed inline
| {ComponentMetaData.keys-to-Iterator }:{Iterator-of String} |
| matches?: | Indicates if other matches attributes of current object. |
| set: | Set meta-data value for key. |
|
protected sealed
| {ComponentMetaData.set-meta-data ...}:void |
| set?: | Indicates if value for key has been set. |
|
public sealed
| {ComponentMetaData.set? key:String}:bool |
| unset: | Unsets an existing value for key. |
|
public sealed inline
| {ComponentMetaData.unset key:String}:void |
(constructor)
Initialize meta-data
component: If specified, the meta-data will be extracted from the component. No other arguments should be provided.
Currently the id is the same as the url-name for the component. This will eventually change.
from-string: parses comma-separated keyword/value pairs from string in Curl source form. For example,
{ComponentMetaData
from-string = |"name = "A", version = "1.0""|
}
copy-from: If not null, meta-data will be copied from specified object.
...: Some number of keyword/value pairs. These may either be specified as keyword arguments or as a string followed by a value. The latter is required for meta-data names that are not simple identifiers. For example:
{new ComponentMetaData,
version="1.2",
"my.private-info", 42
}
(accessor)
accessor public sealed ComponentMetaData.author:#
String setter public sealed ComponentMetaData.author:#
String The name of the author of this component.
(accessor)
accessor public sealed ComponentMetaData.cache-duration:
Time setter public sealed ComponentMetaData.cache-duration:
Time Amount of time component may be cached without doing out-of-date checks.
Description
Indicates how long the component may be cached, either in memory or on disk, without checking to see if it is out-of-date with respect to its underlying sources. This attribute is currently only relevant for Curl packages and manifests.
Negative durations are ignored and are used to indicate no duration has been set.
(accessor)
accessor public sealed inline ComponentMetaData.compilation-time:#
DateTimeData setter public sealed ComponentMetaData.compilation-time:#
DateTimeData Timestamp identifying start of compilation of component.
Description
Generated automatically by the compiler for
Packages.
(accessor)
accessor public sealed inline ComponentMetaData.component-type:#
String setter public sealed ComponentMetaData.component-type:#
String Identifies the type of component.
Description
This is set automatically in many cases:
(accessor)
accessor public sealed inline ComponentMetaData.content-id:#
ComponentID setter public sealed ComponentMetaData.content-id:#
ComponentID A unique, secure content-identifier for the component.
Description
For
Packages, this is automatically generated by the system based on the contents.
(accessor)
accessor public sealed inline ComponentMetaData.content-size:
int setter public sealed ComponentMetaData.content-size:
int The size of the component.
Description
This is automatically computed for Curl packages, applets, and scripts by the system. The units depend on the
file-format:
- "source": characters
- "pcurl": bytes
- "dll", "ocurl" and "exe": characters in the original source
Note that counts of characters in Curl package or script source does not include top-level (i.e., not inside of any curly braces) white space or comments. So the following two packages would produce the same
content-size:
{curl 6.0 package}
{package FOO}
|| This will be ignored
{define-proc public {foo}:void}
{curl 6.0 package}
{package FOO}
{define-proc public {foo}:void}
(accessor)
accessor public sealed ComponentMetaData.copyright:#
String setter public sealed ComponentMetaData.copyright:#
String Copyright message for component.
(accessor)
accessor public sealed inline ComponentMetaData.curl-api-version:#
VersionNumber setter public sealed ComponentMetaData.curl-api-version:#
VersionNumber The API version from the curl herald used to compile component.
Description
This is automatically computed from the
curl herald and will be the version from
curl-versions that matches the Curl API version used to compile the code.
This could be an extended version number, such as "3.0.4+". To obtain the actual API version, use this to match against the versions in
get-installed-api-versions:
{if-non-null my-version = meta-data.curl-api-version then
{for installed-version in {get-installed-api-versions} do
{if {my-version.partial-match? installed-version} then
let my-installed-version:VersionNumber =
installed-version
...
{break}
}
}
}
Alternately, you can simply truncate the version number to two components:
{if-non-null my-version = meta-data.curl-api-version then
let my-installed-version:VersionNumber =
{my-version.n-clone n = 2}
...
}
(accessor)
Contents of curl-file-signatures in this component.
Description
Computed automatically for applets, packages, manifests and scripts, and contains the contents of each
curl-file-signature appearing in the component. The contents are stripped of all whitespace.
(accessor)
accessor public sealed ComponentMetaData.curl-versions:#{
ReadOnlyArray-of VersionNumber}
setter public sealed ComponentMetaData.curl-versions:#{
ReadOnlyArray-of VersionNumber}
List of Curl versions in which the component may be used.
Description
This is automatically taken from the
curl expression used in the source file for the component.
(accessor)
accessor public sealed inline ComponentMetaData.debuggable?:
bool setter public sealed ComponentMetaData.debuggable?:
bool Indicates whether component is debuggable. Defaults to false.
Description
This is set automatically by the compiler for
Packages.
(accessor)
accessor public sealed ComponentMetaData.default-locale:#
String setter public sealed ComponentMetaData.default-locale:#
String Default locale for component
Description
Specified in
applet or
package declarations to identify the default locale for resource location.
See
find-resource for how this used.
Introduced in:
version 6.0
(accessor)
accessor public sealed ComponentMetaData.file:#
String setter public sealed ComponentMetaData.file:#
String Abstract file name of a resource.
Description
Introduced in:
version 6.0
(accessor)
accessor public sealed inline ComponentMetaData.file-format:#
String setter public sealed ComponentMetaData.file-format:#
String The file format of the component.
Description
This is automatically generated for Curl components. Possible values are:
- "source": Curl language source code
- "pcurl": A compressed and preprocessed format that can be used for Curl packages.
- "ocurl": A package in binary format for fast loading from disk. Used by packages in persistent cache. Also see ComponentMetaData.package-caching-style.
- "dll": Indicates component is stored in binary form within a Curl Dynamic Link Library (DLL).
- "exe": Indicates component is stored in binary form with an executable program.
(accessor)
List of filenames included in the component.
(field)
public-get hidden-set ComponentMetaData.frozen?:
bool Indicates if object is "frozen".
Description
When the meta-data object is frozen, any attempt to change meta-data values will result in an error.
(accessor)
accessor public sealed inline ComponentMetaData.id:#
ComponentID The unique identifier for the component.
Description
For
Packages, this is automatically generated by the compiler based on the contents of the source code.
(accessor)
accessor public sealed inline ComponentMetaData.jit-compilable?:
bool setter public sealed ComponentMetaData.jit-compilable?:
bool Indicates whether component may be JIT-compiled. Defaults to true.
(accessor)
accessor public sealed inline ComponentMetaData.jit-compiled?:
bool setter public sealed ComponentMetaData.jit-compiled?:
bool Indicates whether component was JIT-compiled. Defaults to true.
Description
This is set automatically by the compiler.
(accessor)
accessor public sealed ComponentMetaData.license:#
String setter public sealed ComponentMetaData.license:#
String
This item is unsupported and reserved for internal use.
(accessor)
accessor public sealed ComponentMetaData.locale:#
String setter public sealed ComponentMetaData.locale:#
String Identifies the locale of the component.
Description
For runnable components such as applets or scripts, this is used to determine the initial working locale of the program. See
set-working-locale.
For other types of components, such as packages and manifests, specifying this attribute will not affect the working locale but may be used to indicate the locale for which the component is intended to be used.
Also see
ComponentMetaData.matches? for special matching rules for this attribute.
(accessor)
accessor public sealed ComponentMetaData.manifest:#
String setter public sealed ComponentMetaData.manifest:#
String The location of the manifest associated with this component.
Description
The location of the component manifest associated with this component, if any. This must be an absolute URL string.
For applets and scripts, this identifies the location of the default manifest returned by
get-default-manifest.
For packages, this is only used to locate the default manifest if the package was imported with an explicit location and no entry for the package could be found using the manifest used by the importing code (see example).
Note that when this value results from setting the corresponding keyword in the component declaration (e.g.
applet), then any string value will interpreted as a potentially a path relative to the main file:
{curl 6.0 applet}
{applet
manifest = "my-manifest.mcurl"
}
{assert {abs-url? {non-null {this-package}.meta-data.manifest}}}
Example
In the following example, the manifest declaration in package
B allows it to use the manifest to locate package
A, even though the applet does not use a manifest and imports
B using an explicit location. If the applet were to declare a different manifest containing an entry for
B, then
B's manifest declaration would be ignored.
|| manifest.mcurl
{curl 6.0 manifest}
{component package A, location = "a.scurl"}
{component package B, location = "b.scurl"}
|| a.scurl
{curl 6.0 package}
{package A, manifest = "manifest.mcurl"}
...
|| b.scurl
{curl 6.0 package}
{package B, manifest = "manifest.mcurl"}
{import A} || no explicit location given
...
|| applet.curl
{curl 6.0 applet}
{import B, location = "b.scurl"}
...
(accessor)
accessor public sealed inline ComponentMetaData.name:#
String setter public sealed ComponentMetaData.name:#
String The name of the component.
Description
This is the name used when the component was defined.
(accessor)
List of URLs of possible sources for this component.
Description
Includes the actual
source-url-name from which the component was loaded, but may also list additional locations from which an identical component has been loaded.
Only privileged processes may access this attribute on frozen meta-data objects, otherwise a null will be returned.
For packages, this is set automatically at compilation time.
(accessor)
accessor public sealed ComponentMetaData.package-caching-style:#
String setter public sealed ComponentMetaData.package-caching-style:#
String Package caching style for this component.
Description
This attribute is only applicable for runnable components such as applets or scripts. It specifies the manner in which persistent package caching is utilized for that program.
Persistent package caching (introduced in version 3.0 of the Curl API) causes packages to be cached persistently on disk so they may be loaded quickly in subsequent sessions. Caching can be disabled in the Curl Control Panel's General tab. The default setting is enabled.
Possible values are:
- "lazy" (default)
- Packages previously saved in the cache may be used, while new packages will be saved "lazily" in the background. This is the best caching style for most applications, and will usually result in all packages being cached by the time the application exits.
- "on-import"
- Packages are always added to the cache immediately before use. This results in slower initial startup time when packages have not yet been cached.
- "read-only"
- Packages previously saved in the cache may be used, but no new ones will be added.
- "none"
- Disables use of persistent package cache for this program.
To use a setting other than the default, set this attribute in the
applet (or
script) declaration, for example:
{curl 6.0 applet}
{applet
|| Disable persistent package caching.
package-caching-style = "none"
}
Programming Notes
- There is no way to set the package-caching-style for individual import statements; you may only set the attribute for the entire applet.
You may programmatically determine if a package instance was loaded from the cache by checking its
file-format meta-data attribute, for example:
let p:Package = MY-PACKAGE
let from-cache?:bool =
p.meta-data.file-format == "ocurl"
- Even if a package has been persistently cached and the package-caching-style is "lazy" or "read-only", the cached version will not be loaded if there is already a usable instance loaded in memory.
- You may examine information about packages in the cache through the Cache Settings dialog accessible through the Curl Control Panel's General tab.
(accessor)
accessor public sealed ComponentMetaData.release-notes:#
String setter public sealed ComponentMetaData.release-notes:#
String Release notes for this component.
(accessor)
accessor public sealed ComponentMetaData.release-timestamp:#
DateTimeData setter public sealed ComponentMetaData.release-timestamp:#
DateTimeData Release date and time of component.
(accessor)
accessor public final ComponentMetaData.requires-privilege?:
bool setter public final ComponentMetaData.requires-privilege?:
bool Whether component requires privilege to use.
Description
When set to true in a
package declaration, this will prevent the package from being imported when the current process (e.g. applet or script) is not privileged. Indirect non-privileged imports will also be disallowed.
(accessor)
accessor public sealed ComponentMetaData.resource-directory:#
String setter public sealed ComponentMetaData.resource-directory:#
String Specifies root directory containing resources for component.
Description
Introduced in:
version 6.0
(accessor)
accessor public sealed ComponentMetaData.resync-as-of:#
DateTimeData setter public sealed ComponentMetaData.resync-as-of:#
DateTimeData Resynchronization time for component
Description
When specified in the meta-data for an applet, script or manifest this attribute may be used to set the value of
process-resync-as-of, which will force files and components loaded by the applet or script to be synchronized as of the specified time.
When set in
applet or
script declarations, the
utc-date-time syntax is usually used, such as:
{applet
resync-as-of = {utc-date-time "2003-10-11"}
}
See documentation for the
applet declaration for more examples.
(accessor)
accessor public sealed ComponentMetaData.SHA-1-digest:#
SHA-1-Digest setter public sealed ComponentMetaData.SHA-1-digest:#
SHA-1-Digest The SHA-1 digest of a file.
Description
(accessor)
accessor public final ComponentMetaData.source-url:#
Url
(accessor)
accessor public sealed ComponentMetaData.source-url-name:#
String setter public sealed ComponentMetaData.source-url-name:#
String A string containing the absolute Url of the source from which the component is compiled.
Description
This is set automatically at compilation time.
(accessor)
accessor public sealed inline ComponentMetaData.transitive-id:#
ComponentID setter public sealed ComponentMetaData.transitive-id:#
ComponentID A unique id for the component that includes dependencies.
Description
The transitive id is computed from the local
ComponentMetaData.id and the ids of all packages imported directly or indirectly by the component.
(accessor)
accessor public sealed ComponentMetaData.translations-file:#
String setter public sealed ComponentMetaData.translations-file:#
String Specifies name of file containing translations for component.
Description
Introduced in:
version 6.0
(accessor)
accessor public sealed inline ComponentMetaData.version:#
VersionNumber The version of the component.
Description
When comparing using
ComponentMetaData.matches?, version numbers use the
VersionNumber.partial-match? method instead of simple equality. Thus a version number of "1.3" will match any version number that begins with "1.3".
This attribute may also hold
ExtendedVersionNumber values to allow for extended matches. For instance, "1.2.3+" would match any versions of the form "1.2.n" where n is greater than or equal to 3.
(class proc)
| public
| {ComponentMetaData.supported-value-type? type:Type}:bool |
Indicates if type may be used as a meta-data value.
Description
(method)
| public sealed
| {ComponentMetaData.assert-match component:Component}:void |
(method)
| protected final
| {ComponentMetaData.assert-not-frozen}:void |
Asserts that object is not frozen.
Description
Should be invoked prior to beginning any mutating operation on the object.
(method)
Returns copy of object.
Description
The copy will not be frozen.
(method)
| public sealed inline
| {ComponentMetaData.freeze}:void |
Freeze the meta-data so that it cannot be changed.
Description
(method)
| public sealed
| {ComponentMetaData.get key:String}:any |
Get meta-data value for given key.
key: The name of the meta-data item. Must match a key that was previously used to set a value.
Returns
(method)
| public sealed
| {ComponentMetaData.get-if-exists key:String }:(value:any, found?:bool) |
Get meta-data value for given key.
key: The name of the meta-data item and a flag that indicates whether the requested item was found. Must match a key that was previously used to set a value.
Returns
Returns the value associated with the key or default.
Also returns a boolean which indicates if the element was found.
(method)
| public sealed inline
| {ComponentMetaData.keys-to-Iterator }:{Iterator-of String} |
Returns an iterator for the keys in the meta-data.
Description
Only returns keys for which values have been set.
This allows meta-data objects to be used in a keyed
for-loop as in:
{for value:any key keyword:String in meta-data do
...
}
(method)
Indicates if other matches attributes of current object.
Returns
a
bool indicating whether there was a match, and the name of the first meta-data value that does not match.
Description
The
other is considered a match if for each meta-data value set in the current object, the corresponding element in
other has the same value.
For values of type
VersionNumber, the
VersionNumber.partial-match? method is used instead of a simple equality comparison.
For values of type
{ReadOnlyArray-of VersionNumber}, the
VersionNumber.partial-match? method is used to verify that each version number in the array for this object is a partial match for one in the array for
other.
Other types of
ReadOnlyArray-of values simply use
ReadOnlyArray-of.equal?.
A special exception is made for the
curl-api-version: if it is not defined in the
other object, then a match will still be allowed if a matching version number is found in the the
other meta-data's
curl-versions list.
Another exception is made for the "locale" attribute. In addition to an exact match, a locale string will also be considered a match if the
other object's locale attribute is missing or null, is the value "default" or is the same as first part of the locale string upto a '.', '-', or '@' character. For instance, the locale string "en-US.UTF-8" will match "en-US.UTF-8", "en-US.UTF", "en-US", "en", "default" or a missing value. Also see
ComponentSelector.compare for how locales affect the ordering of matches.
(method)
Set meta-data value for key.
Description
(method)
| protected sealed
| {ComponentMetaData.set-meta-data ...}:void |
Sets meta-data from ...
Description
(method)
| public sealed
| {ComponentMetaData.set? key:String}:bool |
Indicates if value for key has been set.
(method)
| public sealed inline
| {ComponentMetaData.unset key:String}:void |
Unsets an existing value for key.
Description
If the
key identifies an option, it will revert to its default value. No error is produced if value was not previously set. However, it is an error if
ComponentMetaData.frozen?.