com.taco.swinger.text2gui
Class ComponentConstraintPairConverter

java.lang.Object
  extended by com.taco.text.AbstractInterpolatingStringToObjectConverter
      extended by com.taco.text.InterpolatingConverter
          extended by com.taco.swinger.text2gui.ComponentConstraintPairConverter
All Implemented Interfaces:
IInterpolatingConverter, IInterpolatingStringToObjectConverter, IStringToObjectConverter, IInterpolatingResourceBundleToObjectConverter, java.lang.Cloneable
Direct Known Subclasses:
ComponentLayerPairConverter

public class ComponentConstraintPairConverter
extends InterpolatingConverter

A converter to instances of ComponentConstraintPair.


Field Summary
protected  DispatchingComponentConverter _componentConverter
          The converter of strings and resource bundles to components that are to be added to a container.
protected  java.awt.Container _parent
          The parent container for components created by this instance.
 
Fields inherited from class com.taco.text.InterpolatingConverter
_BAD_OBJECT_MAPPER, _IGNORE_PROPERTY_VALUE, _IMPORTS, _STATIC_IMPORTS, _TO_OBJECT_MAPPER_CONVERTER, DEFAULT_INSTANCE
 
Fields inherited from class com.taco.text.AbstractInterpolatingStringToObjectConverter
_defArgMap, _defBundle
 
Constructor Summary
  ComponentConstraintPairConverter(java.awt.Container parent, DispatchingComponentConverter componentConverter)
           
protected ComponentConstraintPairConverter(DispatchingComponentConverter componentConverter)
          A constructor for subclasses to invoke that allows leaves the parent null, because _getConstraintConverter() has been overloaded not to use the parent.
 
Method Summary
protected  IInterpolatingConverter _getConstraintConverter()
          Return the converter used for constraints.
protected  java.lang.Object _literalToObject(java.lang.String s, java.util.ResourceBundle bundle, INoReturnMap argMap, java.lang.String globalName)
          Given s, which is a string literal, not a reference to a resource bundle key or a key in the argument map, convert s to an object.
protected  java.lang.String _makeConstraintKey(java.lang.String baseKey)
          Given the base key of the component / constraint pair, return a key to lookup in the resource bundle for the constraint associated with the component.
 java.lang.Object toObject(java.util.ResourceBundle bundle, java.lang.String baseKey, INoReturnMap argMap, KeyLookupRecord context)
          There is no point in overriding _toObject() instead since we don't expect to put an instance of ComponentAndSavedConstraintData in the global variable space.
 
Methods inherited from class com.taco.text.InterpolatingConverter
_argMapReferenceToObject, _getStandardImports, _getStandardStaticImports, _literalResultToObject, _scriptSnippetToObject, _toObject, _toObjectMapper, clone, name, toObject, toObject
 
Methods inherited from class com.taco.text.AbstractInterpolatingStringToObjectConverter
toObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parent

protected final java.awt.Container _parent
The parent container for components created by this instance.


_componentConverter

protected final DispatchingComponentConverter _componentConverter
The converter of strings and resource bundles to components that are to be added to a container.

Constructor Detail

ComponentConstraintPairConverter

public ComponentConstraintPairConverter(java.awt.Container parent,
                                        DispatchingComponentConverter componentConverter)

ComponentConstraintPairConverter

protected ComponentConstraintPairConverter(DispatchingComponentConverter componentConverter)
A constructor for subclasses to invoke that allows leaves the parent null, because _getConstraintConverter() has been overloaded not to use the parent.

Method Detail

toObject

public java.lang.Object toObject(java.util.ResourceBundle bundle,
                                 java.lang.String baseKey,
                                 INoReturnMap argMap,
                                 KeyLookupRecord context)
                          throws java.text.ParseException,
                                 java.util.MissingResourceException
There is no point in overriding _toObject() instead since we don't expect to put an instance of ComponentAndSavedConstraintData in the global variable space.

Specified by:
toObject in interface IInterpolatingResourceBundleToObjectConverter
Overrides:
toObject in class InterpolatingConverter
Throws:
java.text.ParseException
java.util.MissingResourceException

_literalToObject

protected java.lang.Object _literalToObject(java.lang.String s,
                                            java.util.ResourceBundle bundle,
                                            INoReturnMap argMap,
                                            java.lang.String globalName)
                                     throws java.text.ParseException,
                                            java.util.MissingResourceException
Description copied from class: InterpolatingConverter

Given s, which is a string literal, not a reference to a resource bundle key or a key in the argument map, convert s to an object.

*

This implementation simply returns s unchanged.

Overrides:
_literalToObject in class InterpolatingConverter
Throws:
java.text.ParseException
java.util.MissingResourceException

_makeConstraintKey

protected java.lang.String _makeConstraintKey(java.lang.String baseKey)

Given the base key of the component / constraint pair, return a key to lookup in the resource bundle for the constraint associated with the component.

This base implementation returns the base key concatenated with ".constraint"


_getConstraintConverter

protected IInterpolatingConverter _getConstraintConverter()
Return the converter used for constraints. This base implementation returns the instance of IComponentAddStrategy provided by the component converter, for the parent container. This method is called by _literalToString() and toObject(ResourceBundle bundle, ...).