com.threerings.antidote.field
Interface FieldWrapper<F extends ReferenceField>

All Superinterfaces:
Field, Mutable, RequiresValidation
All Known Implementing Classes:
BaseFieldWrapper, OptionalField, RequiredField

public interface FieldWrapper<F extends ReferenceField>
extends Mutable, Field

Wraps a Field object and provides methods to handle the mutability of that object and any ReferenceField aspects of that Field.


Method Summary
 F getField()
          Returns the Field held by this FieldWrapper.
 Field getParent()
          Return the parent Field of the wrapped Field.
 void setField(F wrapped)
          Set the wrapped Field.
 
Methods inherited from interface com.threerings.antidote.Mutable
isNotSet, isSet
 
Methods inherited from interface com.threerings.antidote.field.Field
getFieldName, getLocation
 
Methods inherited from interface com.threerings.antidote.RequiresValidation
validate
 

Method Detail

setField

void setField(F wrapped)
Set the wrapped Field. Provided so that the wrapped Field may be set whenever an Ant setter method is called, which may be after this FieldWrapper was constructed. It is a violation to set the wrapped Field more than once and the FieldWrapper will fail in RequiresValidation.validate().


getField

F getField()
Returns the Field held by this FieldWrapper. If the held Field is set that object will be returned. If the Field is set and is a Reference to another Field, the referenced Field will be returned. Finally, if the Field is not set, RequiresValidationException will be thrown. Use Mutable.isSet() or Mutable.isNotSet() to determine the status of the held Field before calling this method.

Throws:
RequiresValidationException - if the held Field is not set.

getParent

Field getParent()
Return the parent Field of the wrapped Field.



Copyright © 2007-2008 Three Rings Design, Inc. All Rights Reserved. Released under a BSD license.