org.wildfly.swarm.config.jca.BeanValidation Maven / Gradle / Ivy
The newest version!
package org.wildfly.swarm.config.jca;
import org.wildfly.swarm.config.runtime.AttributeDocumentation;
import org.wildfly.swarm.config.runtime.ResourceDocumentation;
import org.wildfly.swarm.config.runtime.SingletonResource;
import org.wildfly.swarm.config.runtime.Address;
import org.wildfly.swarm.config.runtime.ResourceType;
import org.wildfly.swarm.config.runtime.Implicit;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import org.wildfly.swarm.config.runtime.ModelNodeBinding;
/**
* Bean validation (JSR-303) for resource adapters
*/
@Address("/subsystem=jca/bean-validation=bean-validation")
@ResourceType("bean-validation")
@Implicit
public class BeanValidation>
implements
org.wildfly.swarm.config.runtime.Keyed {
private String key;
private PropertyChangeSupport pcs;
@AttributeDocumentation("Specify whether bean validation is enabled")
private Boolean enabled;
public BeanValidation() {
super();
this.key = "bean-validation";
this.pcs = new PropertyChangeSupport(this);
}
public String getKey() {
return this.key;
}
/**
* Adds a property change listener
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (null == this.pcs)
this.pcs = new PropertyChangeSupport(this);
this.pcs.addPropertyChangeListener(listener);
}
/**
* Removes a property change listener
*/
public void removePropertyChangeListener(
java.beans.PropertyChangeListener listener) {
if (this.pcs != null)
this.pcs.removePropertyChangeListener(listener);
}
/**
* Specify whether bean validation is enabled
*/
@ModelNodeBinding(detypedName = "enabled")
public Boolean enabled() {
return this.enabled;
}
/**
* Specify whether bean validation is enabled
*/
@SuppressWarnings("unchecked")
public T enabled(java.lang.Boolean value) {
Object oldValue = this.enabled;
this.enabled = value;
if (this.pcs != null)
this.pcs.firePropertyChange("enabled", oldValue, value);
return (T) this;
}
}