package gw.globalization uses java.lang.UnsupportedOperationException uses gw.lang.reflect.IType /** * Behavior defined for properties that are unsupported. */ class UnsupportedPropertyBehavior implements InvariantPropertyBehavior { public static final var DEFAULT_MESSAGE_FORMAT : String = "The {0} class does not support the {1} property." public static final var READONLY_MESSAGE_FORMAT : String = "The {0} class does not support setting the {1} property (it is read-only)" var _className : String var _messageFormat : String construct(type : IType) { this(type, DEFAULT_MESSAGE_FORMAT) } construct(type : IType, messageFormat : String) { _className = type.RelativeName _messageFormat = messageFormat } override function getValue() : T { return null } override function setValue(fieldName : String) { throw new UnsupportedOperationException(_messageFormat.formatMessage({_className, fieldName})) } }