Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.endeca.portal.metadata
Class MetadataProperty

    java.lang.Object
      com.endeca.portal.metadata.AbstractMetadata
          com.endeca.portal.metadata.MetadataProperty

All Implemented Interfaces:
  Metadata

Direct Known Subclasses:
  AttributeSetDisplayName, AttributeSetMapping

    public abstract class MetadataProperty

extends AbstractMetadata

Abstract class representing a Metadata Property. This class provides a basic Metadata implementation for getting and setting the base fields for a Metadata Property (except for "Type" which is meant to be implementation-specific) and storing an instance of the backing Liferay `MetadataPropertyRecord`.

Author:
  Endeca Technologies, Inc.

Constructor Summary
`MetadataProperty()` Constructor that creates a new Metadata object property and its underlying MetadataPropertyRecord object.
`MetadataProperty(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)` Constructor that creates a new Metadata object and assigns a given MetadataPropertyRecord to its underlying object.

Method Summary
`boolean` | `equals(java.lang.Object obj)` Indicates whether some other object is "equal to" this one.
`long` | `getPropertyId()` Gets the Metadata Property's ID
`com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord` | `getSourceRecord()` Gets the underlying Liferay source record
`abstract java.lang.String` | `getType()` Gets the implementation-specific type.
`protected void` | `init(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)` Initializes this AbstractMetadataObject from a MetadataPropertyRecord
`void` | `setPropertyId(long propertyId)` Sets the Metadata Property's ID
`void` | `setSourceRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord rec)` Sets the underlying Liferay source record

Methods inherited from class com.endeca.portal.metadata.AbstractMetadata
`getDescription, getFeature, getKey, getLastUpdated, getLocale, getObjectId, getRel, getSource, getValue, setDescription, setFeature, setKey, setLastUpdated, setLocale, setObjectId, setRel, setSource, setValue, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### MetadataProperty

    public MetadataProperty()

  Constructor that creates a new Metadata object property and its underlying MetadataPropertyRecord object. The underlying object is initialized with an id of -1 and is not persisted to the database; that must be done explicitly if you want it to be persisted.

### MetadataProperty

    public MetadataProperty(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)

  Constructor that creates a new Metadata object and assigns a given MetadataPropertyRecord to its underlying object. The underlying object is not persisted to the database; that must be done explicitly if you want it to be persisted.

  Parameters:
    `record` - the source MetadataRecord

Method Detail

### init

    protected void init(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)

  Initializes this AbstractMetadataObject from a MetadataPropertyRecord

  Parameters:
    `record` - the MetadataPropertyRecord from which this Metadata Object should be initialized

### getType

    public abstract java.lang.String getType()

  Gets the implementation-specific type.

  Specified by:
    `getType` in interface `Metadata`
  Specified by:
    `getType` in class `AbstractMetadata`
  Returns:
    the type of metadata this object represents
  See Also:
    `MetadataObject.getType()`

### getSourceRecord

    public com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord getSourceRecord()

  Gets the underlying Liferay source record

  Returns:
    the source record

### setSourceRecord

    public void setSourceRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord rec)

  Sets the underlying Liferay source record

  Parameters:
    `rec` - the source record

### getPropertyId

    public long getPropertyId()

  Gets the Metadata Property's ID

  Returns:
    the property ID

### setPropertyId

    public void setPropertyId(long propertyId)

  Sets the Metadata Property's ID

  Parameters:
    `propertyId` - the property ID

### equals

    public boolean equals(java.lang.Object obj)

  Indicates whether some other object is "equal to" this one. Returns true if the other object is a MetadataProperty and its property ID is the same as this one's ID. If the property ID is -1 for either this object or the other object, false will be returned. TODO: What actually should happen when the property ID is -1?

  Overrides:
    `equals` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD