@Test public void set_encoding_type_conflict() { FormSupportImpl support = new FormSupportImpl(null, null); support.setEncodingType("foo"); try { support.setEncodingType("bar"); unreachable(); } catch (IllegalStateException ex) { assertEquals(ex.getMessage(), "Encoding type of form has already been set to \'foo\' and may not be changed to \'bar\'."); } }
public void setEncodingType(String encodingType) { assert InternalUtils.isNonBlank(encodingType); if (this.encodingType != null && !this.encodingType.equals(encodingType)) throw new IllegalStateException(String.format("Encoding type of form has already been set to '%s' and may not be changed to '%s'.", this.encodingType, encodingType)); this.encodingType = encodingType; }
FormSupportImpl implements InternalFormSupport, Locatable { public void setEncodingType(String encodingType) { assert InternalUtils.isNonBlank(encodingType); if (this.encodingType != null && !this.encodingType.equals(encodingType)) throw new IllegalStateException(String.format("Encoding type of form has already been set to '%s' and may not be changed to '%s'.", this.encodingType, encodingType)); this.encodingType = encodingType; } }
FormSupportImpl implements InternalFormSupport, Locatable { public void setEncodingType(String encodingType) { assert InternalUtils.isNonBlank(encodingType); if (this.encodingType != null && !this.encodingType.equals(encodingType)) throw new IllegalStateException(String.format("Encoding type of form has already been set to '%s' and may not be changed to '%s'.", this.encodingType, encodingType)); this.encodingType = encodingType; } FormSupportImpl(ComponentResources resources, String formValidationId);  FormSupportImpl(ComponentResources resources, String clientId, ComponentActionSink actionSink,
                           boolean clientValidationEnabled, IdAllocator idAllocator,
                           String formValidationId); }
FormSupportImpl implements InternalFormSupport, Locatable { public void setEncodingType(String encodingType) { assert InternalUtils.isNonBlank(encodingType); if (this.encodingType != null && !this.encodingType.equals(encodingType)) throw new IllegalStateException(String.format("Encoding type of form has already been set to '%s' and may not be changed to '%s'.", this.encodingType, encodingType)); this.encodingType = encodingType; } FormSupportImpl(ComponentResources resources, String formValidationId);  FormSupportImpl(ComponentResources resources, String clientId, ComponentActionSink actionSink,
                           boolean clientValidationEnabled, IdAllocator idAllocator,
                           String formValidationId); Location getLocation(); String getFormComponentId(); String allocateControlName(String id); void store(T component, ComponentAction<T> action); void storeCancel(T component, ComponentAction<T> action); void storeAndExecute(T component, ComponentAction<T> action); void defer(Runnable command); void executeDeferred(); String getClientId(); String getEncodingType(); void setEncodingType(String encodingType); void addValidation(Field field, String validationName, String message, Object constraint); boolean isClientValidationEnabled(); String getFormValidationId(); }
FormSupportImpl implements InternalFormSupport, Locatable { public void setEncodingType(String encodingType) { assert InternalUtils.isNonBlank(encodingType); if (this.encodingType != null && !this.encodingType.equals(encodingType)) throw new IllegalStateException(String.format("Encoding type of form has already been set to '%s' and may not be changed to '%s'.", this.encodingType, encodingType)); this.encodingType = encodingType; } FormSupportImpl(ComponentResources resources, String formValidationId);  FormSupportImpl(ComponentResources resources, String clientId, ComponentActionSink actionSink,
                           boolean clientValidationEnabled, IdAllocator idAllocator,
                           String formValidationId); Location getLocation(); String getFormComponentId(); String allocateControlName(String id); void store(T component, ComponentAction<T> action); void storeCancel(T component, ComponentAction<T> action); void storeAndExecute(T component, ComponentAction<T> action); void defer(Runnable command); void executeDeferred(); String getClientId(); String getEncodingType(); void setEncodingType(String encodingType); void addValidation(Field field, String validationName, String message, Object constraint); boolean isClientValidationEnabled(); String getFormValidationId();  }