org.apache.qpid.management.domain.model
Class QpidProperty

java.lang.Object
  extended by org.apache.qpid.management.domain.model.QpidFeature
      extended by org.apache.qpid.management.domain.model.QpidAttribute
          extended by org.apache.qpid.management.domain.model.QpidProperty
Direct Known Subclasses:
QpidArgument

 class QpidProperty
extends QpidAttribute

Qpid property definition.


Nested Class Summary
(package private) static interface QpidProperty.Decoder
          Decoder interface used for decoding incomng values for this property.
(package private)  class QpidProperty.NumberValidator
          Validator responsible for validating numbers.
(package private)  class QpidProperty.StringValidator
          Validator responsible for validating strings.
 
Field Summary
(package private)  QpidProperty.Decoder _decoder
           
(package private)  QpidProperty.Decoder _mandatoryPropertyDecoder
          Decoder used for decoding incoming values for this mandatory property.
(package private)  QpidProperty.Decoder _optionalPropertyDecoder
          Decoder used for decoding incoming values for this optional property.
(package private) static IValidator EMPTY_VALIDATOR
          Null object used to perform a dummy validation.
 
Fields inherited from class org.apache.qpid.management.domain.model.QpidAttribute
_type, _unit
 
Fields inherited from class org.apache.qpid.management.domain.model.QpidFeature
_description, _name
 
Constructor Summary
QpidProperty()
           
 
Method Summary
(package private)  Object decodeValue(org.apache.qpid.transport.codec.Decoder decoder, byte[] presenceBitMasks)
          Gets the value of this property according to its type definition.
(package private)  AccessMode getAccessMode()
          Gets the description of this property.
(package private)  int getMaxLength()
          Gets the max length value for this property.
(package private)  int getMaxValue()
          Gets the maximum allowed value for this property.
(package private)  int getMinValue()
          Gets the minimum allowed value for this property.
(package private)  boolean isOptional()
          Returns true if this property is marked as optional.
(package private)  void markAsOptional(int index)
          Marks this property as optional.
(package private)  void setAccessMode(AccessMode accessMode)
          Sets access mode for this property.
(package private)  void setMaxLength(int maxLength)
          Sets the max length value for this property.
(package private)  void setMaxValue(int maxValue)
          Sets the masimum allowed value for this property.
(package private)  void setMinValue(int minValue)
          Sets the minimum allowed value for this property.
(package private)  void setType(Type type)
          Sets the type of this property.
(package private)  void validate(Object value)
          Validates the given value according to the current validator.
 
Methods inherited from class org.apache.qpid.management.domain.model.QpidAttribute
decodeValue, getJavaType, getUnit, setUnit, toString
 
Methods inherited from class org.apache.qpid.management.domain.model.QpidFeature
getDescription, getName, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_optionalPropertyDecoder

final QpidProperty.Decoder _optionalPropertyDecoder
Decoder used for decoding incoming values for this optional property.


_mandatoryPropertyDecoder

final QpidProperty.Decoder _mandatoryPropertyDecoder
Decoder used for decoding incoming values for this mandatory property.


EMPTY_VALIDATOR

static final IValidator EMPTY_VALIDATOR
Null object used to perform a dummy validation. This is the default validator installed at creation time.


_decoder

QpidProperty.Decoder _decoder
Constructor Detail

QpidProperty

QpidProperty()
Method Detail

validate

void validate(Object value)
        throws ValidationException
Validates the given value according to the current validator. It delegates the validation to the current installed validator.

Parameters:
value - the value of this qpid property.
Throws:
ValidationException - when the given value is violating the current validator constraints.

setType

void setType(Type type)
Sets the type of this property. In addition this method tries to detect if a validator has been associated with the type. If no validator is found then the default validator will be used; that is : no validator will be performed on this property.

Overrides:
setType in class QpidAttribute
Parameters:
type - the type of this property.

decodeValue

Object decodeValue(org.apache.qpid.transport.codec.Decoder decoder,
                   byte[] presenceBitMasks)
Gets the value of this property according to its type definition.

Parameters:
decoder - the decoder used to extract the value.
Returns:
the value of this feature according to its type definition

setAccessMode

void setAccessMode(AccessMode accessMode)
Sets access mode for this property.

Parameters:
accessMode - the access mode for this property.

getMinValue

int getMinValue()
Gets the minimum allowed value for this property.

Returns:
the minimum allowed value for this property.

setMinValue

void setMinValue(int minValue)
Sets the minimum allowed value for this property.

Parameters:
minValue - the minimum allowed value for this property.

getMaxValue

int getMaxValue()
Gets the maximum allowed value for this property.

Returns:
the maximum allowed value for this property.

setMaxValue

void setMaxValue(int maxValue)
Sets the masimum allowed value for this property.

Parameters:
maxValue - the maximum allowed value for this property.

getMaxLength

int getMaxLength()
Gets the max length value for this property.

Returns:
the max length value for this property.

setMaxLength

void setMaxLength(int maxLength)
Sets the max length value for this property.

Parameters:
maxLength - the max length value for this property.

getAccessMode

AccessMode getAccessMode()
Gets the description of this property.

Returns:
the description of this property.

markAsOptional

void markAsOptional(int index)
Marks this property as optional.

Parameters:
optional - the optional attribute value for this property.
index - the index of this optional property

isOptional

boolean isOptional()
Returns true if this property is marked as optional.

Returns:
true if this property is marked as optional, false otherwise.


Licensed to the Apache Software Foundation