mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/asset/AssetModel.java
public void validateValue(final FacesContext context, final UIComponent component, 
            final Object value) throws ValidatorException
    {
        ValidationEnum result = ValidationEnum.PARSING_FAILURE;
        
        final Double parsedValue = Double.parseDouble(value.toString());
        
        if (component.getId().equals("assetLatLocation"))
        {
            final int latMin = -90;
            final int latMax = 90;
            result = minMaxCheckInclusive(latMin, latMax, parsedValue);
        }
        else if (component.getId().equals("assetLongLocation"))
        {
            final int longMin = -180;
            final int longMax = 180;
            result = minMaxCheckInclusive(longMin, longMax, parsedValue);
        }
        else if (component.getId().equals("assetAltitudeLocation"))
        {
            final int altMin = -10000;
            final int altMax = 50000;
            result = minMaxCheckInclusive(altMin, altMax, parsedValue);
        }
        else if (component.getId().equals("assetBankLocation"))
        {
            final int bankMin = -180;
            final int bankMax = 180;
            result = minMaxCheckInclusive(bankMin, bankMax, parsedValue);
        }
        else if (component.getId().equals("assetElevationLocation"))
        {
            final int eleMin = -90;
            final int eleMax = 90;
            result = minMaxCheckInclusive(eleMin, eleMax, parsedValue);
        }
        else if (component.getId().equals("assetHeadingLocation"))
        {
            final int headMin = 0;
            final int headMax = 360;
            if (parsedValue < headMin)
            {
                result = ValidationEnum.LESS_THAN_MIN;
            }
            else if (parsedValue >= headMax)
            {
                result = ValidationEnum.GREATER_THAN_MAX;
            }
            else
            {
                result = ValidationEnum.PASSED;
            }
        }
        
        if (result != ValidationEnum.PASSED)
        {
            final FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, result.toString(), null);
            throw new ValidatorException(msg);
        }
    }
/**
     * Validate the values for the location fields.
     * @param context
     *          The current faces context, method interface is defined by JSF so parameter is required even if not used
     * @param component
     *          The JSF component calling the validate method.
     * @param value
     *          The value being validated.
     * @throws ValidatorException
     *          Thrown value passed is not valid.
     */
Validate the values for the location fields.
@param context
The current faces context, method interface is defined by JSF so parameter is required even if not used
@param component
The JSF component calling the validate method.
@param value
The value being validated.
@throws ValidatorException
Thrown value passed is not valid.
Validate the values for the location fields . @param context The current faces context method interface is defined by JSF so parameter is required even if not used @param component The JSF component calling the validate method . @param value The value being validated . @throws ValidatorException Thrown value passed is not valid .
public void validateValue(final FacesContext context, final UIComponent component, 
            final Object value) throws ValidatorException
    {
        ValidationEnum result = ValidationEnum.PARSING_FAILURE;
        final Double parsedValue = Double.parseDouble(value.toString());
        if (component.getId().equals("assetLatLocation"))
        {
            final int latMin = -90;
            final int latMax = 90;
            result = minMaxCheckInclusive(latMin, latMax, parsedValue);
        }
        else if (component.getId().equals("assetLongLocation"))
        {
            final int longMin = -180;
            final int longMax = 180;
            result = minMaxCheckInclusive(longMin, longMax, parsedValue);
        }
        else if (component.getId().equals("assetAltitudeLocation"))
        {
            final int altMin = -10000;
            final int altMax = 50000;
            result = minMaxCheckInclusive(altMin, altMax, parsedValue);
        }
        else if (component.getId().equals("assetBankLocation"))
        {
            final int bankMin = -180;
            final int bankMax = 180;
            result = minMaxCheckInclusive(bankMin, bankMax, parsedValue);
        }
        else if (component.getId().equals("assetElevationLocation"))
        {
            final int eleMin = -90;
            final int eleMax = 90;
            result = minMaxCheckInclusive(eleMin, eleMax, parsedValue);
        }
        else if (component.getId().equals("assetHeadingLocation"))
        {
            final int headMin = 0;
            final int headMax = 360;
            if (parsedValue < headMin)
            {
                result = ValidationEnum.LESS_THAN_MIN;
            }
            else if (parsedValue >= headMax)
            {
                result = ValidationEnum.GREATER_THAN_MAX;
            }
            else
            {
                result = ValidationEnum.PASSED;
            }
        }
        if (result != ValidationEnum.PASSED)
        {
            final FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, result.toString(), null);
            throw new ValidatorException(msg);
        }
    }
public void validateValue ( final FacesContext context , final UIComponent component , final Object value ) throws ValidatorException { ValidationEnum result = ValidationEnum . PARSING_FAILURE ; final Double parsedValue = Double . parseDouble ( value . toString ( ) ) ; if ( component . getId ( ) . equals ( "assetLatLocation" ) ) { final int latMin = - 90 ; final int latMax = 90 ; result = minMaxCheckInclusive ( latMin , latMax , parsedValue ) ; } else if ( component . getId ( ) . equals ( "assetLongLocation" ) ) { final int longMin = - 180 ; final int longMax = 180 ; result = minMaxCheckInclusive ( longMin , longMax , parsedValue ) ; } else if ( component . getId ( ) . equals ( "assetAltitudeLocation" ) ) { final int altMin = - 10000 ; final int altMax = 50000 ; result = minMaxCheckInclusive ( altMin , altMax , parsedValue ) ; } else if ( component . getId ( ) . equals ( "assetBankLocation" ) ) { final int bankMin = - 180 ; final int bankMax = 180 ; result = minMaxCheckInclusive ( bankMin , bankMax , parsedValue ) ; } else if ( component . getId ( ) . equals ( "assetElevationLocation" ) ) { final int eleMin = - 90 ; final int eleMax = 90 ; result = minMaxCheckInclusive ( eleMin , eleMax , parsedValue ) ; } else if ( component . getId ( ) . equals ( "assetHeadingLocation" ) ) { final int headMin = 0 ; final int headMax = 360 ; if ( parsedValue < headMin ) { result = ValidationEnum . LESS_THAN_MIN ; } else if ( parsedValue >= headMax ) { result = ValidationEnum . GREATER_THAN_MAX ; } else { result = ValidationEnum . PASSED ; } } if ( result != ValidationEnum . PASSED ) { final FacesMessage msg = new FacesMessage ( FacesMessage . SEVERITY_ERROR , result . toString ( ) , null ) ; throw new ValidatorException ( msg ) ; } }
Validate the values for the location fields.
Validate the values for the location fields .