/** * Returns the value converter associated with this parameter, if any. * * @return The parameter value converter, or <code>null</code> if there is * no value converter for this parameter. * @throws NotDefinedException * if the parameter type is not currently defined */ public final AbstractParameterValueConverter getValueConverter() throws NotDefinedException { if (!isDefined()) { throw new NotDefinedException( "Cannot use getValueConverter() with an undefined ParameterType"); //$NON-NLS-1$ } return parameterTypeConverter; }
/** * Returns the value converter associated with this parameter, if any. * * @return The parameter value converter, or <code>null</code> if there is * no value converter for this parameter. * @throws NotDefinedException * if the parameter type is not currently defined */ public final AbstractParameterValueConverter getValueConverter() throws NotDefinedException { if (!isDefined()) { throw new NotDefinedException( "Cannot use getValueConverter() with an undefined ParameterType"); //$NON-NLS-1$ } return parameterTypeConverter; }
/** * Returns the value converter associated with this parameter, if any. * * @return The parameter value converter, or <code>null</code> if there is * no value converter for this parameter. * @throws NotDefinedException * if the parameter type is not currently defined */ public final AbstractParameterValueConverter getValueConverter() throws NotDefinedException { if (!isDefined()) { throw new NotDefinedException( "Cannot use getValueConverter() with an undefined ParameterType"); //$NON-NLS-1$ } return parameterTypeConverter; }
/** * Returns whether the provided value is compatible with this parameter * type. An object is compatible with a parameter type if the object is an * instance of the class defined as the parameter's type class. * * @param value * an object to check for compatibility with this parameter type; * may be <code>null</code>. * @return <code>true</code> if the value is compatible with this type, * <code>false</code> otherwise * @throws NotDefinedException * if the parameter type is not currently defined */ public boolean isCompatible(Object value) throws NotDefinedException { if (!isDefined()) { throw new NotDefinedException( "Cannot use isCompatible() with an undefined ParameterType"); //$NON-NLS-1$ } return isInstanceOf(value, type); }
/** * Returns whether the provided value is compatible with this parameter * type. An object is compatible with a parameter type if the object is an * instance of the class defined as the parameter's type class. * * @param value * an object to check for compatibility with this parameter type; * may be <code>null</code>. * @return <code>true</code> if the value is compatible with this type, * <code>false</code> otherwise * @throws NotDefinedException * if the parameter type is not currently defined */ public boolean isCompatible(Object value) throws NotDefinedException { if (!isDefined()) { throw new NotDefinedException( "Cannot use isCompatible() with an undefined ParameterType"); //$NON-NLS-1$ } return isInstanceOf(value, type); }
/** * Returns whether the provided value is compatible with this parameter * type. An object is compatible with a parameter type if the object is an * instance of the class defined as the parameter's type class. * * @param value * an object to check for compatibility with this parameter type; * may be <code>null</code>. * @return <code>true</code> if the value is compatible with this type, * <code>false</code> otherwise * @throws NotDefinedException * if the parameter type is not currently defined */ public boolean isCompatible(Object value) throws NotDefinedException { if (!isDefined()) { throw new NotDefinedException( "Cannot use isCompatible() with an undefined ParameterType"); //$NON-NLS-1$ } return isInstanceOf(value, type); }
/** * {@inheritDoc} * * @since 3.2 */ @Override public final void parameterTypeChanged(final ParameterTypeEvent parameterTypeEvent) { if (parameterTypeEvent.isDefinedChanged()) { final ParameterType parameterType = parameterTypeEvent.getParameterType(); final String parameterTypeId = parameterType.getId(); final boolean parameterTypeIdAdded = parameterType.isDefined(); if (parameterTypeIdAdded) { definedParameterTypeIds.add(parameterTypeId); } else { definedParameterTypeIds.remove(parameterTypeId); } fireCommandManagerChanged(new CommandManagerEvent(this, parameterTypeId, parameterTypeIdAdded, true)); } }
/** * {@inheritDoc} * * @since 3.2 */ @Override public final void parameterTypeChanged(final ParameterTypeEvent parameterTypeEvent) { if (parameterTypeEvent.isDefinedChanged()) { final ParameterType parameterType = parameterTypeEvent.getParameterType(); final String parameterTypeId = parameterType.getId(); final boolean parameterTypeIdAdded = parameterType.isDefined(); if (parameterTypeIdAdded) { definedParameterTypeIds.add(parameterTypeId); } else { definedParameterTypeIds.remove(parameterTypeId); } fireCommandManagerChanged(new CommandManagerEvent(this, parameterTypeId, parameterTypeIdAdded, true)); } }
/** * {@inheritDoc} * * @since 3.2 */ @Override public void parameterTypeChanged(final ParameterTypeEvent parameterTypeEvent) { if (parameterTypeEvent.isDefinedChanged()) { final ParameterType parameterType = parameterTypeEvent.getParameterType(); final String parameterTypeId = parameterType.getId(); final boolean parameterTypeIdAdded = parameterType.isDefined(); if (parameterTypeIdAdded) { definedParameterTypeIds.add(parameterTypeId); } else { definedParameterTypeIds.remove(parameterTypeId); } fireCommandManagerChanged(new CommandManagerEvent(this, parameterTypeId, parameterTypeIdAdded, true)); } }
if (!parameterType.isDefined()) { parameterType.define(type, parameterValueConverter);