# Metadata | Antville 1.4 API Reference

Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-4-22 10:17

# Class Metadata

- Defined in: Metadata.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Metadata() The Metadata prototype provides means to store one metadata key-value pair per record in the metadata database table.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| name The name (key) of the metadata object.
| parent The HopObject the metadata belongs to.
| type The type of the metadata object.
| value The value of the metadata object.

## Method Summary

Method Attributes | Method Name and Description
--- | ---
<static> | Metadata.getTypeProperties() Get an object representing the type properties settings suitable for defining prototypes with the definePrototype() method.
| getValue() Get the value of a metadata object.
<static> | Metadata.normalize(value) Prepare a value for writing it to the metadata database table.
| onUnhandledMacro(name) Handle macros which are not defined elsewhere.
| setValue(value) Set the value of a metadata object.
| toString() Get a textual representation of the metadata object.

## Class Detail

Metadata()
The Metadata prototype provides means to store one metadata key-value pair per record in the metadata database table. Each record is assigned to a parent HopObject which is fitted with convenient methods to easily retrieve and modify the attached metadata objects.

See:
  HopObject#handleMetadata

## Field Detail

{String} name
The name (key) of the metadata object.
{HopObject} parent
The HopObject the metadata belongs to.
{String} type
The type of the metadata object.
{Object} value
The value of the metadata object.

## Method Detail

- <static> {Object} Metadata.getTypeProperties()
  Get an object representing the type properties settings suitable for defining prototypes with the definePrototype() method.
  Returns:
    {Object} The type properties settings as object.
  See:
    Helma documentation
- {Object} getValue()
  Get the value of a metadata object.
  Returns:
    {Object} The value of the metadata object.
- <static> {Array} Metadata.normalize(value)
  Prepare a value for writing it to the metadata database table. The type of each metadata is stored along with its value. The normalize() method determines the type and possibly modifies the value accordingly.
  Parameters:
  {Object} value
  Returns:
    {Array} Compound value consisting of two elements, the (normalized) metadata value and its type.
- {Object} onUnhandledMacro(name)
  Handle macros which are not defined elsewhere.
  Parameters:
  {String} name
    The name of the macro.
  Returns:
    {Object} The resulting value.
- setValue(value)
  Set the value of a metadata object. If the value equals null the metadata object will be removed.
  Parameters:
  {Object} value
    The desired metadata value.
- {String} toString()
  Get a textual representation of the metadata object.
  Returns:
    {String} A textual representation of the metadata object.