dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=false
jar.index=${jnlp.enabled}
javac.classpath=\
- ${file.reference.jcore-logger-lib.jar}:\
${libs.javaee-api-7.0.classpath}
# Space-separated list of extra javac options
javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
-source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/
src.dir=src
test.src.dir=test
* <p>
* @throws ValidatorException If something more horrible went wrong
*/
- protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, Boolean allowNull) throws ValidatorException {
- // Trace message
- //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("preValidate: context={0},component={1},value={2},requiredFields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
+ protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, final Boolean allowNull) throws ValidatorException {
+ // Are all parameter set?
+ if (null == context) {
+ // Throw NPE
+ throw new NullPointerException("Parameter context is null"); //NOI18N
+ } else if (null == component) {
+ // Throw NPE again
+ throw new NullPointerException("Parameter component is null"); //NOI18N
+ } else if (null == requiredFields) {
+ // Throw it again
+ throw new NullPointerException("Parameter requiredFields is null"); //NOI18N
+ } else if (null == allowNull) {
+ // Throw it once more
+ throw new NullPointerException("Parameter allowNull is null"); //NOI18N
+ }
// Init message and key
String requiredMessage = null;
// Check component's id against required fields and find a match
for (final String field : requiredFields) {
- // Get logger
- //this.getLogger().logDebug(MessageFormat.format("preValidate: field={0},clientId={1}", field, clientId)); //NOI18N
-
// Is it the same?
if (clientId.endsWith(field)) {
// Is it null?
}
}
- // Debug message
- //* NOISY-DEBUG: */ this.getLogger().logDebug(MessageFormat.format("preValidate: requiredMessage={0}", requiredMessage)); //NOI18N
// Is it not null?
if (null != requiredMessage) {
- throw new ValidatorException(new FacesMessage(MessageFormat.format("Value {0} for clientId={1} is not valid/unexpected.", value, clientId)));
+ throw new ValidatorException(new FacesMessage(MessageFormat.format("Value {0} for clientId={1} is not valid/unexpected.", value, clientId))); //NOI18N
}
-
- // Trace message
- //* NOISY-DEBUG: */ System.out.println("preValidate: EXIT!"); //NOI18N
}
}
private static final long serialVersionUID = 42_378_178_715_910_689L;
@Override
- public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, Boolean allowNull) throws ValidatorException {
- // Trace message
- //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("preValidate: context={0},component={1},value={2},requiredFields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
+ public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, final Boolean allowNull) throws ValidatorException {
+ // Are all parameter set?
+ if (null == context) {
+ // Throw NPE
+ throw new NullPointerException("Parameter context is null"); //NOI18N
+ } else if (null == component) {
+ // Throw NPE again
+ throw new NullPointerException("Parameter component is null"); //NOI18N
+ } else if (null == requiredFields) {
+ // Throw it again
+ throw new NullPointerException("Parameter requiredFields is null"); //NOI18N
+ } else if (null == allowNull) {
+ // Throw it once more
+ throw new NullPointerException("Parameter allowNull is null"); //NOI18N
+ }
// Pre-validate
super.preValidate(context, component, value, requiredFields, allowNull);
// Get client id and init message + key
- String clientId = component.getClientId();
+ final String clientId = component.getClientId();
String requiredMessage = null;
// So far all fine, no check if the field is fine
for (final String field : requiredFields) {
- // Debug message
- //this.getLogger().logDebug(MessageFormat.format("preValidate: field={0},clientId={1}", field, clientId)); //NOI18N
-
// Is it the same?
if (clientId.endsWith(field)) {
// Compare value's type
@Override
public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, Boolean allowNull) throws ValidatorException {
- // Trace message
- //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("preValidate: context={0},component={1},value={2},requiredFields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
+ // Are all parameter set?
+ if (null == context) {
+ // Throw NPE
+ throw new NullPointerException("Parameter context is null"); //NOI18N
+ } else if (null == component) {
+ // Throw NPE again
+ throw new NullPointerException("Parameter component is null"); //NOI18N
+ } else if (null == requiredFields) {
+ // Throw it again
+ throw new NullPointerException("Parameter requiredFields is null"); //NOI18N
+ } else if (null == allowNull) {
+ // Throw it once more
+ throw new NullPointerException("Parameter allowNull is null"); //NOI18N
+ }
// Pre-validate
super.preValidate(context, component, value, requiredFields, allowNull);
// Get client id and init message + key
- String clientId = component.getClientId();
+ final String clientId = component.getClientId();
String requiredMessage = null;
// So far all fine, no check if the field is fine
for (final String field : requiredFields) {
- // Debug message
- //this.getLogger().logDebug(MessageFormat.format("preValidate: field={0},clientId={1}", field, clientId)); //NOI18N
-
// Is it the same?
if (clientId.endsWith(field)) {
// Compare value's type
private static final long serialVersionUID = 25_481_878_590_589_321L;
@Override
- public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, Boolean allowNull) throws ValidatorException {
- // Trace message
- //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("preValidate: context={0},component={1},value={2},requiredFields={3},allowNull={4} - CALLED!", context, component, value, Arrays.toString(requiredFields, allowNull))); //NOI18N
+ public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, final Boolean allowNull) throws ValidatorException {
+ // Are all parameter set?
+ if (null == context) {
+ // Throw NPE
+ throw new NullPointerException("Parameter context is null"); //NOI18N
+ } else if (null == component) {
+ // Throw NPE again
+ throw new NullPointerException("Parameter component is null"); //NOI18N
+ } else if (null == requiredFields) {
+ // Throw it again
+ throw new NullPointerException("Parameter requiredFields is null"); //NOI18N
+ } else if (null == allowNull) {
+ // Throw it once more
+ throw new NullPointerException("Parameter allowNull is null"); //NOI18N
+ }
// Pre-validate
super.preValidate(context, component, value, requiredFields, allowNull);
// Get client id and init message + key
- String clientId = component.getClientId();
+ final String clientId = component.getClientId();
String requiredMessage = null;
// So far all fine, no check if the field is fine
private static final long serialVersionUID = 15_484_578_781_760_287L;
@Override
- protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, Boolean allowNull) throws ValidatorException {
- // Trace message
- //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("preValidate: context={0},component={1},value={2},fields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
+ protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, final Boolean allowNull) throws ValidatorException {
+ // Are all parameter set?
+ if (null == context) {
+ // Throw NPE
+ throw new NullPointerException("Parameter context is null"); //NOI18N
+ } else if (null == component) {
+ // Throw NPE again
+ throw new NullPointerException("Parameter component is null"); //NOI18N
+ } else if (null == requiredFields) {
+ // Throw it again
+ throw new NullPointerException("Parameter requiredFields is null"); //NOI18N
+ } else if (null == allowNull) {
+ // Throw it once more
+ throw new NullPointerException("Parameter allowNull is null"); //NOI18N
+ }
// Pre-validate (example: on null)
super.preValidate(context, component, value, requiredFields, allowNull);
// Get client id and init message + key
- String clientId = component.getClientId();
+ final String clientId = component.getClientId();
String requiredMessage = null;
// So far all fine, no check if the field is fine
for (final String field : requiredFields) {
- // Debug message
- //this.getLogger().logDebug(MessageFormat.format("preValidate: field={0},clientId={1}", field, clientId)); //NOI18N
-
// Is it the same?
if (clientId.endsWith(field)) {
// Compare value's type
}
}
- // Debug message
- //this.getLogger().logDebug(MessageFormat.format("preValidate: requiredMessage={0}", requiredMessage)); //NOI18N
-
// Is it not null?
if (null != requiredMessage) {
// Then there was something wrong with it
throw new ValidatorException(new FacesMessage(requiredMessage));
}
-
- // Trace message
- //* NOISY-DEBUG: */ System.out.println("preValidate: EXIT!"); //NOI18N
}
}