/*
/////////////////////////////////////////////////
Public API, validation
/////////////////////////////////////////////////
328261
@SuppressWarnings("cast")
    @Override
    public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize)
        throws XMLStreamException
    {
        /* Let's skip leading/trailing white space, even if we are not
         * to normalize visible attribute value. This allows for better
         * round-trip handling (no changes for physical value caller
         * gets), but still allows succesful validation.
         */
        while (start < end && WstxInputData.isSpaceChar(cbuf[start])) {
            ++start;
        }

        // No id?
        if (start >= end) {
            return reportValidationProblem(v, "Empty IDREFS value");
        }

        --end; // so that it now points to the last char
        // We now the first char is not a space by now...
        while (end > start && WstxInputData.isSpaceChar(cbuf[end])) {
            --end;
        }

        // Ok; now start points to first, end to last char (both inclusive)
        ElementIdMap m = v.getIdMap();
        Location loc = v.getLocation();

        String idStr = null;
        StringBuilder sb = null;
        while (start <= end) {
            // Ok, need to check char validity, and also calc hash code:
            char c = cbuf[start];
            if (!WstxInputData.isNameStartChar(c, mCfgNsAware, mCfgXml11)) {
                return reportInvalidChar(v, c, "not valid as the first IDREFS character");
            }
            int hash = (int) c;
            int i = start+1;
            for (; i <= end; ++i) {
                c = cbuf[i];
                if (WstxInputData.isSpaceChar(c)) {
                    break;
                }
                if (!WstxInputData.isNameChar(c, mCfgNsAware, mCfgXml11)) {
                    return reportInvalidChar(v, c, "not valid as an IDREFS character");
                }
                hash = (hash * 31) + (int) c;
            }

            // Ok, got the next id ref...
            ElementId id = m.addReferenced(cbuf, start, i - start, hash,
                                           loc, v.getElemName(), mName);
            
            // Can skip the trailing space char (if there was one)
            start = i+1;

            /* When normalizing, we can possibly share id String, or
             * alternatively, compose normalized String if multiple
             */
            if (normalize) {
                if (idStr == null) { // first idref
                    idStr = id.getId();
                } else {
                    if (sb == null) {
                        sb = new StringBuilder(idStr);
                    }
                    idStr = id.getId();
                    sb.append(' ');
                    sb.append(idStr);
                }
            }

            // Ok, any white space to skip?
            while (start <= end && WstxInputData.isSpaceChar(cbuf[start])) {
                ++start;
            }
        }

        if (normalize) {
            if (sb != null) {
                idStr = sb.toString();
            }
            return idStr;
        }

        return null;
    }
376558
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $count = 0;
        $classAttribute = $contentObjectAttribute->contentClassAttribute();
        if ( $http->hasPostVariable( $base . "_data_multioption_id_" . $contentObjectAttribute->attribute( "id" ) ) )
        {
            $classAttribute = $contentObjectAttribute->contentClassAttribute();
            $multioptionIDArray = $http->postVariable( $base . "_data_multioption_id_" . $contentObjectAttribute->attribute( "id" ) );

            foreach ( $multioptionIDArray as $id )
            {
                $multioptionName = $http->postVariable( $base . "_data_multioption_name_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id );
                $optionIDArray = $http->hasPostVariable( $base . "_data_option_id_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                 ? $http->postVariable( $base . "_data_option_id_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                 : array();
                $optionCountArray = $http->hasPostVariable( $base . "_data_option_option_id_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                    ? $http->postVariable( $base . "_data_option_option_id_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                    : array();
                $optionValueArray = $http->hasPostVariable( $base . "_data_option_value_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                    ? $http->postVariable( $base . "_data_option_value_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                    : array();
                $optionAdditionalPriceArray = $http->hasPostVariable( $base . "_data_option_additional_price_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                              ? $http->postVariable( $base . "_data_option_additional_price_" . $contentObjectAttribute->attribute( "id" ) . '_' . $id )
                                              : array();
                for ( $i = 0; $i < count( $optionIDArray ); $i++ )
                {
                    if ( $contentObjectAttribute->validateIsRequired() and !$classAttribute->attribute( 'is_information_collector' ) )
                    {
                        if ( trim( $optionValueArray[$i] ) == "" )
                        {
                            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                                 'The option value must be provided.' ) );
                            return eZInputValidator::STATE_INVALID;
                        }
                        else
                            ++$count;
                    }

                    if ( trim( $optionValueArray[$i] ) != "" )
                    {
                        if ( strlen( $optionAdditionalPriceArray[$i] ) && !preg_match( "#^[-|+]?[0-9]+(\.){0,1}[0-9]{0,2}$#", $optionAdditionalPriceArray[$i] ) )
                        {
                            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                                 'The additional price for the multioption value is not valid.' ) );
                            return eZInputValidator::STATE_INVALID;
                        }
                    }

                }
            }
        }
        if ( $contentObjectAttribute->validateIsRequired() and
                 !$classAttribute->attribute( 'is_information_collector' ) )
        {
            if ( $count == 0 )
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                     'At least one option is required.' ) );
                return eZInputValidator::STATE_INVALID;
            }

            $optionSetName = $http->hasPostVariable( $base . "_data_optionset_name_" . $contentObjectAttribute->attribute( "id" ) )
                             ? $http->postVariable( $base . "_data_optionset_name_" . $contentObjectAttribute->attribute( "id" ) )
                             : '';
            if ( trim( $optionSetName ) == '' )
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                     'Option set name is required.' ) );
                return eZInputValidator::STATE_INVALID;
            }
        }


        return eZInputValidator::STATE_ACCEPTED;
    }
321673
public function validate() {

		if ($this->getCurrency() === null) {
			throw new ValidationException("'currency' can't be null", 'currency', $this);
		}
		if ($this->getProduct() === null) {
			throw new ValidationException("'product' can't be null", 'product', $this);
		}
		if ($this->getSubscription() === null) {
			throw new ValidationException("'subscription' can't be null", 'subscription', $this);
		}
	}
321034
public void validate(Object o)
    {
        String s = String.valueOf(o);
        int i = s.indexOf(".");
        if (i == -1)
        {
            if ((m_integerDigits != -1 && s.length() > m_integerDigits))
            {            	
                String message = m_propertyMetadata.getMessageSourceAccessor().getMessage(m_message, new Object[]{ m_propertyMetadata.getLabelName(), m_integerDigits,m_fractionalDigits, String.valueOf(o) });
                throw new ValidationException(message);
            }
        }
        else
        {
            if (m_integerDigits != -1 && s.length() > m_integerDigits)
            {
                String message = m_propertyMetadata.getMessageSourceAccessor().getMessage(m_message, new Object[]{ m_propertyMetadata.getLabelName(), m_integerDigits,m_fractionalDigits,String.valueOf(o) });
                throw new ValidationException(message);
            }
            if (m_fractionalDigits != -1 && (s.length()-(i+1)) > m_fractionalDigits)
            {
                String message = m_propertyMetadata.getMessageSourceAccessor().getMessage(m_message, new Object[]{ m_propertyMetadata.getLabelName(),m_integerDigits,m_fractionalDigits, String.valueOf(o) });
                throw new ValidationException(message);
            }
        }
   }
127853
function invalid(data, meta, thing) {
	if (data === undefined && meta.required)
		return true;

	let type = meta.type;
	
	// missing type accepts anything
	if (type === undefined)
		return false;
		
	// application defined type?
	
	if (thing.model.types && thing.model.types.hasOwnProperty(type))
		return invalid(data, thing.model.types[type], thing);
		
	if (typeof (meta.enum) === 'array') {
		list = meta.enum;
		
		for (let i = 0; i < list.length; ++i ) {
			if (data === list[i])
				return false;
		}
		
		return true;
	}
	
	if (type === 'null' && data !== null)
		return true;
		
	if (type === 'const' && data !== meta.const)
		return true;
	
	if (type === 'boolean')
		return !(data === true || data === false);
		
	if (type === 'string') {
		if (typeof data !== 'string')
			return true;
			
		if (meta.regex) {
			const regex = new RegExp(meta.regex);
			return ! regex.test(data);
		}
		
		return false;
	}
		
	if (type === 'number' || type === 'integer') {		
		if (typeof data !== 'number')
			return true;
			
		if (type === 'integer' && !Number.isInteger(data))
			return true;
						
		if (meta.minimum !== undefined && data < meta.minimum)
			return true;
			
		if (meta.maximum !== undefined && data > meta.maximum)
			return true;
			
		return false;
	}
	
	// arrays and objects are more complicated
	// is it acceptable for data to be null when expecting an array?
	
	if (type === 'array') {
		if (!Array.isArray(data))
			return true;
			
		let length = data.length;
		
		if (meta.minItems !== undefined && length < meta.minItems)
			return true;
			
		if (meta.maxItems !== undefined && length > meta.maxItems)
			return true;
			
		let items = meta.items;
		
		if (items !== undefined) {
			for (let i = 0; i < length; ++i) {
				if (!invalid(data[i], meta, thing))
					return true;
			}
		}
		
		return false;
	}
	
	// is it acceptable for data to be null when expecting an object?
	
	if (type === 'object') {
		if (data === null || typeof data !== 'object' || Array.isArray(data))
			return true;
		let properties = meta.properties;
			
		for (name in data) {
			if (data.hasOwnProperty(name)) {
				if (!properties.hasOwnProperty(name))
					return true;
					
				if (invalid(data[name], properties[name], thing)) {
					return true;
				}
			}
		}
		
		let required = meta.required;
		
		if (required === undefined)
			return false;
			
		// we need to check for missing required properties
		
		for (let i = 0; i < required.length; ++i) {
			if (!data.hasOwnProperty(required[i]))
				return true;
		}
			
		return false;
	}
	
	return true;
}
275814
@Override
    public org.fcrepo.server.types.gen.Validation validate(String pid,
                                                           String asOfDateTime) {
        assertInitialized();
        try {
            MessageContext ctx = context.getMessageContext();
            return TypeUtility
                    .convertValidationToGenValidation(m_management.validate(ReadOnlyContext
                                                                                        .getSoapContext(ctx),
                                                                                pid,
                                                                                DateUtility
                                                                                        .parseDateOrNull(asOfDateTime)));
        } catch (Throwable th) {
            LOG.error("Error validating", th);
            throw CXFUtility.getFault(th);
        } finally {
            LOG.debug("end: validate");
        }
    }
669335
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $classAttribute = $contentObjectAttribute->contentClassAttribute();
        $useSeconds = ( $classAttribute->attribute( self::USE_SECONDS_FIELD ) == 1 );

        if ( $http->hasPostVariable( $base . '_datetime_year_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_month_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_day_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_hour_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_minute_' . $contentObjectAttribute->attribute( 'id' ) ) and
             ( !$useSeconds or $http->hasPostVariable( $base . '_datetime_second_' . $contentObjectAttribute->attribute( 'id' ) ) ) )
        {
            $year   = $http->postVariable( $base . '_datetime_year_' . $contentObjectAttribute->attribute( 'id' ) );
            $month  = $http->postVariable( $base . '_datetime_month_' . $contentObjectAttribute->attribute( 'id' ) );
            $day    = $http->postVariable( $base . '_datetime_day_' . $contentObjectAttribute->attribute( 'id' ) );
            $hour   = $http->postVariable( $base . '_datetime_hour_' . $contentObjectAttribute->attribute( 'id' ) );
            $minute = $http->postVariable( $base . '_datetime_minute_' . $contentObjectAttribute->attribute( 'id' ) );
            $second = $useSeconds ? $http->postVariable( $base . '_datetime_second_' . $contentObjectAttribute->attribute( 'id' ) ) : 0;

            if ( $year == '' or
                 $month == '' or
                 $day == '' or
                 $hour == '' or
                 $minute == '' or
                 ( $useSeconds and $second == '' ) )
            {
                if ( !( $year == '' and
                        $month == '' and
                        $day == '' and
                        $hour == '' and
                        $minute == '' and
                        ( !$useSeconds or $second == '' ) ) or
                     ( !$classAttribute->attribute( 'is_information_collector' ) and
                       $contentObjectAttribute->validateIsRequired() ) )
                {
                    $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                         'Missing datetime input.' ) );
                    return eZInputValidator::STATE_INVALID;
                }
                else
                    return eZInputValidator::STATE_ACCEPTED;
            }
            else
            {
                return $this->validateDateTimeHTTPInput( $day, $month, $year, $hour, $minute, $second, $contentObjectAttribute );
            }
        }
        else if ( !$classAttribute->attribute( 'is_information_collector' ) and $contentObjectAttribute->validateIsRequired() )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Missing datetime input.' ) );
            return eZInputValidator::STATE_INVALID;
        }
        else
            return eZInputValidator::STATE_ACCEPTED;
    }
847254
function api(){
  var _res = this;

  if(typeof(_res) != "object" && _is_not_has_prototype('end')){
    arguments = [];
    console.dir('not a object')
  }
  
  if (arguments.length == 1) {
    var http_code = 200;
    var api_data      = arguments[0];
    var api_status    = {
      code : 0,
      msg  : 'request success!'
    }
    
    return _api(http_code, api_data, api_status);
  } else if (arguments.length == 2) {
    var http_code = 200;
    var api_data      = arguments[0];
    var api_status    = arguments[1];
    
    return _api(http_code, api_data, api_status);
  } else if (arguments.length == 3) {
    var http_code = arguments[0];
    var api_data      = arguments[1];
    var api_status    = arguments[2];
    
    return _api(http_code, api_data, api_status);
  } else {
    var http_code = 200;
    var api_data      = {};
    var api_status    = {
      code : 222222222,
      msg  : 'res.api params error or res is not a express.response object!'
    }
    
    return _api(http_code, api_data, api_status);
  }
  
  function _is_not_has_prototype(name){
    console.dir(_res)
    return !_res.hasOwnProperty(name)&&(name in _res);
  }
  
  function _api (http_code, data, status) {
    if (_res.is_jsonp && _res.is_jsonp == true) {
      return _res.status(http_code).jsonp({
        data    : data,
        status  : status
      })
    } else {
      return _res.status(http_code).json({
        data    : data,
        status  : status
      })
    }
  }
}
1246453
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        if ( $http->hasPostVariable( $base . "_data_user_login_" . $contentObjectAttribute->attribute( "id" ) ) &&
             $http->hasPostVariable( $base . "_data_user_email_" . $contentObjectAttribute->attribute( "id" ) ) &&
             $http->hasPostVariable( $base . "_data_user_password_" . $contentObjectAttribute->attribute( "id" ) ) &&
             $http->hasPostVariable( $base . "_data_user_password_confirm_" . $contentObjectAttribute->attribute( "id" ) ) )
        {
            $classAttribute = $contentObjectAttribute->contentClassAttribute();
            $loginName = strip_tags( $http->postVariable( $base . "_data_user_login_" . $contentObjectAttribute->attribute( "id" ) ) );
            $email = $http->postVariable( $base . "_data_user_email_" . $contentObjectAttribute->attribute( "id" ) );
            $password = $http->postVariable( $base . "_data_user_password_" . $contentObjectAttribute->attribute( "id" ) );
            $passwordConfirm = $http->postVariable( $base . "_data_user_password_confirm_" . $contentObjectAttribute->attribute( "id" ) );
            if ( trim( $loginName ) == '' )
            {
                if ( $contentObjectAttribute->validateIsRequired() || trim( $email ) != '' )
                {
                    $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                         'The username must be specified.' ) );
                    return eZInputValidator::STATE_INVALID;
                }
            }
            else
            {
                $existUser = eZUser::fetchByName( $loginName );
                if ( $existUser != null )
                {
                    $userID = $existUser->attribute( 'contentobject_id' );
                    if ( $userID !=  $contentObjectAttribute->attribute( "contentobject_id" ) )
                    {
                        $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                             'The username already exists, please choose another one.' ) );
                        return eZInputValidator::STATE_INVALID;
                    }
                }
                // validate user email
                $isValidate = eZMail::validate( $email );
                if ( !$isValidate )
                {
                    $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                         'The email address is not valid.' ) );
                    return eZInputValidator::STATE_INVALID;
                }

                $authenticationMatch = eZUser::authenticationMatch();
                if ( $authenticationMatch & eZUser::AUTHENTICATE_EMAIL )
                {
                    if ( eZUser::requireUniqueEmail() )
                    {
                        $userByEmail = eZUser::fetchByEmail( $email );
                        if ( $userByEmail != null )
                        {
                            $userID = $userByEmail->attribute( 'contentobject_id' );
                            if ( $userID !=  $contentObjectAttribute->attribute( "contentobject_id" ) )
                            {
                                $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                                     'A user with this email already exists.' ) );
                                return eZInputValidator::STATE_INVALID;
                            }
                        }
                    }
                }
                // validate user name
                if ( !eZUser::validateLoginName( $loginName, $errorText ) )
                {
                    $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                         $errorText ) );
                    return eZInputValidator::STATE_INVALID;
                }
                // validate user password
                $ini = eZINI::instance();
                $generatePasswordIfEmpty = $ini->variable( "UserSettings", "GeneratePasswordIfEmpty" ) == 'true';
                if ( !$generatePasswordIfEmpty || ( $password != "" ) )
                {
                    if ( $password == "" )
                    {
                        $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                             'The password cannot be empty.',
                                                                             'eZUserType' ) );
                        return eZInputValidator::STATE_INVALID;
                    }
                    if ( $password !== $passwordConfirm )
                    {
                        $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                             'The passwords do not match.',
                                                                             'eZUserType' ) );
                        return eZInputValidator::STATE_INVALID;
                    }
                    if ( !eZUser::validatePassword( $password ) )
                    {
                        $minPasswordLength = $ini->variable( 'UserSettings', 'MinPasswordLength' );
                        $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                             'The password must be at least %1 characters long.', null, array( $minPasswordLength ) ) );
                        return eZInputValidator::STATE_INVALID;
                    }
                    if ( strtolower( $password ) == 'password' )
                    {
                        $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                             'The password must not be "password".' ) );
                        return eZInputValidator::STATE_INVALID;
                    }
                }

                // validate confirm email
                if ( $ini->variable( 'UserSettings', 'RequireConfirmEmail' ) == 'true' )
                {
                    $emailConfirm = $http->postVariable( $base . "_data_user_email_confirm_" . $contentObjectAttribute->attribute( "id" ) );
                    if ( $email != $emailConfirm )
                    {
                        $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                             'The emails do not match.',
                                                                             'eZUserType' ) );
                        return eZInputValidator::STATE_INVALID;
                    }
                }
            }
        }
        else if ( $contentObjectAttribute->validateIsRequired() )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Input required.' ) );
            return eZInputValidator::STATE_INVALID;
        }
        return eZInputValidator::STATE_ACCEPTED;
    }
784826
async function () {
    const oThis = this
    ;

    try {
      //validations
      if (!basicHelper.isBTNameValid(oThis.name)) {
        let errObj = responseHelper.error({
          internal_error_identifier: 's_ob_pbt_1',
          api_error_identifier: 'invalid_branded_token_name',
          error_config: basicHelper.fetchErrorConfig()
        });

        return Promise.resolve(errObj);
      }
      if (!basicHelper.isBTSymbolValid(oThis.symbol)) {
        let errObj = responseHelper.error({
          internal_error_identifier: 's_ob_pbt_2',
          api_error_identifier: 'invalid_branded_token_symbol',
          error_config: basicHelper.fetchErrorConfig()
        });

        return Promise.resolve(errObj);
      }
      if (!basicHelper.isBTConversionFactorValid(oThis.conversionFactor)) {
        let errObj = responseHelper.error({
          internal_error_identifier: 's_ob_pbt_3',
          api_error_identifier: 'invalid_conversion_factor',
          error_config: basicHelper.fetchErrorConfig()
        });

        return Promise.resolve(errObj);
      }

      const conversionRateConversionResponse = basicHelper.convertConversionFactorToConversionRate(oThis.conversionFactor);

      if (conversionRateConversionResponse.isSuccess()) {

        oThis.conversionRate = conversionRateConversionResponse.data.conversionRate;
        oThis.conversionRateDecimals = conversionRateConversionResponse.data.conversionRateDecimals;

        const proposalRsp = await openSTUtility.proposeBrandedToken(stakerAddr, stakerPassphrase, oThis.symbol,
          oThis.name, oThis.conversionRate, oThis.conversionRateDecimals);

        if (proposalRsp.isSuccess()) {
          proposalRsp.data.transaction_uuid = uuid.v4();
        }

        return Promise.resolve(proposalRsp);

      } else {
        return Promise.resolve(conversionRateConversionResponse);
      }

    } catch (err) {
      let errObj = responseHelper.error({
        internal_error_identifier: 's_ob_pbt_4',
        api_error_identifier: 'something_went_wrong',
        error_config: basicHelper.fetchErrorConfig()
      });

      return Promise.resolve(errObj);
    }
  }
358009
public List<ValidationData> getValidationDatas(ParamType paramType, String key) {
        if (this.urlMap == null || this.validationDataRuleListMap == null) {
            log.info("url map is empty :: " + key );
            return null;
        }

        if (key == null || paramType == null) {
            throw new ValidationLibException("any parameter is null", HttpStatus.INTERNAL_SERVER_ERROR);
        }

        ReqUrl reqUrl = urlMap.get(key);
        if (reqUrl == null) {
            log.info("reqUrl is null :" + key);
            return null;
        }

        return validationDataRuleListMap.get(paramType.getUniqueKey(reqUrl.getUniqueKey()));
    }
1215246
@Override
    public void validate() {
        if (value == null) {
            throw new NoValueGivenException(getPath());
        }

        if (valids.size() != 0) {
            boolean ok = false;
            String valString = (value != null) ? value.toString() : "";

            for (int i = 0; i < valids.size(); i++) {
                if (valids.get(i).equals(valString)) {
                    ok = true;
                    break;
                }
            }

            if (!ok) {
                throw new NoValidValueException(getPath(), valString);
            }
        }

        setValid(true);
    }
1289689
function validateClassAttributeHTTPInput( $http, $base, $classAttribute )
    {
        $startValueName = $base . self::START_VALUE_VARIABLE . $classAttribute->attribute( "id" );
        $digitsName = $base . self::DIGITS_VARIABLE . $classAttribute->attribute( "id" );

        if ( $http->hasPostVariable( $startValueName ) and
             $http->hasPostVariable( $digitsName ) )
        {
            $startValueValue = str_replace( " ", "", $http->postVariable( $startValueName ) );
            $digitsValue = str_replace( " ", "", $http->postVariable( $digitsName ) );

            $startValueValueState = $this->IntegerValidator->validate( $startValueValue );
            $digitsValueState = $this->IntegerValidator->validate( $digitsValue );

            if ( ( $startValueValueState == eZInputValidator::STATE_ACCEPTED ) and
                 ( $digitsValueState == eZInputValidator::STATE_ACCEPTED ) )
            {
                return eZInputValidator::STATE_ACCEPTED;
            }
            return eZInputValidator::STATE_INTERMEDIATE;
        }
        return eZInputValidator::STATE_INVALID;
    }
1100284
public void checkRequest(BasicCheckInfo basicCheckInfo, Object bodyObj) {
        String key = basicCheckInfo.getUniqueKey();

        List<ValidationData> checkData = this.validationStore.getValidationDatas(basicCheckInfo.getParamType(), key);

        if (checkData == null || checkData.isEmpty()) {
            return;
        }
        checkData.stream().forEach(data -> {
            this.checkDataInnerRules(data, bodyObj);
        });
    }
485631
public void validatePublicVoidNoArg(boolean isStatic, List<Throwable> errors) {
        validatePublicVoid(isStatic, errors);
        if (method.getParameterTypes().length != 0) {
            errors.add(new Exception("Method " + method.getName() + " should have no parameters"));
        }
    }
708596
@JsonIgnore
    public void validate() throws OpsGenieClientValidationException {
        if (apiKey == null)
            throw OpsGenieClientValidationException.missingMandatoryProperty(OpsGenieClientConstants.API.API_KEY);
    }
965455
function validateProposalJoint(objJoint, callbacks){
	var objUnit = objJoint.unit;
	if (typeof objUnit !== "object" || objUnit === null)
		return callbacks.ifInvalid("no unit object");
	
	console.log("\nvalidating joint identified by unit "+objJoint.unit.unit);
	
	if (!isStringOfLength(objUnit.unit, constants.HASH_LENGTH))
		return callbacks.ifInvalid("wrong unit length");
	
	// UnitError is linked to objUnit.unit, so we need to ensure objUnit.unit is true before we throw any UnitErrors
	if (objectHash.getProposalUnitHash(objUnit) !== objUnit.unit){
		// console.log("888888888888888888888888--Proposal joint : " + JSON.stringify(objJoint));
		return callbacks.ifInvalid("wrong proposal unit hash: "+objectHash.getProposalUnitHash(objUnit)+" != "+objUnit.unit);
	}
	

	if (hasFieldsExcept(objUnit, ["unit", "version", "alt" ,"round_index","pow_type","timestamp", "parent_units", "last_ball", "last_ball_unit", "messages", "hp"]))
		return callbacks.ifInvalid("unknown fields in nonserial unit");
	
	if (objUnit.version !== constants.version)
		return callbacks.ifInvalid("wrong version");
	if (objUnit.alt !== constants.alt)
		return callbacks.ifInvalid("wrong alt");
	if (typeof objUnit.round_index !== "number")
		return callbacks.ifInvalid("no round index");
	if (typeof objUnit.pow_type !== "number")
		return callbacks.ifInvalid("no pow_type type");
	if (typeof objUnit.hp !== "number")
		return callbacks.ifInvalid("no hp type");
	
	// pow_type type should be 2 for trustme 
	if ( objUnit.pow_type !==  constants.POW_TYPE_TRUSTME)
		return callbacks.ifInvalid("invalid unit type");
	// unity round index should be in range of [1,4204800]
	if ( objUnit.round_index < 1 || objUnit.round_index > 4204800)
		return callbacks.ifInvalid("invalid unit round index");
	
	if (!isNonemptyArray(objUnit.messages))
		return callbacks.ifInvalid("missing or empty messages array");
	// only one 'data_feed' message allowed in trust me units.
	if (objUnit.messages.length !== 1) 
		return callbacks.ifInvalid("only one message allowed in proposal unit");
	
	// Joint fields validation   add last_ball_mci for only proposal joint, used for final trustme unit
	if (hasFieldsExcept(objJoint, ["unit", "proposer", "phase", "address","last_ball_mci", "idv","vp","isValid","sig"]))
		return callbacks.ifInvalid("unknown fields in joint unit " + json.stringify(objJoint));
	
	if (typeof objJoint.phase !== "number" || objJoint.phase < 0 )
		return callbacks.ifInvalid("joint phase invalid");
	if(objJoint.proposer && objJoint.proposer.length !== 1)
		return callbacks.ifInvalid("multiple proposers are not allowed");
		
	var conn = null;
	var objValidationState = { };
	async.series(
		[
			function(cb){
				db.takeConnectionFromPool(function(new_conn){
					conn = new_conn;
					conn.query("BEGIN", function(){cb();});
				});
			},
			function(cb){
				//validate roundIndex and hp (mci) to see if I am sync with proposer mci
				//if not, return -1 to let caller knows .
				round.getCurrentRoundIndex(conn, function(curRoundIndex){
					if(objUnit.round_index < curRoundIndex)
						return cb("proposer's round_index is too old, curRoundIndex: " + curRoundIndex + " proposer round_index: " +objUnit.round_index );
					if(objUnit.round_index > curRoundIndex)
						return cb({error_code: "unresolved_dependency", errorMessage:"propose round_index is ahead of me , curRoundIndex: " + curRoundIndex + " proposer round_index: " +objUnit.round_index });
					storage.getMaxMci(conn,function(curMCI){
						if(objUnit.hp < curMCI + 1) // recieve old proposal
							return cb("proposal hp is old, will discard it");
						if(objUnit.hp > curMCI + 1 ) // propose mci is ahead of me 
							return cb({error_code: "unresolved_dependency", errorMessage:"propose mci is ahead of me, will handle it once come up with it " });
						cb();
					});
				});
			},
			function(cb){
				validateParents(conn, objJoint, objValidationState, cb);
			},
			// function(cb){
			// 	profiler.stop('validation-parents');
			// 	profiler.start();
			// 	!objJoint.skiplist_units
			// 		? cb()
			// 		: validateSkiplist(conn, objJoint.skiplist_units, cb);
			// },
			function(cb){
				// validate proposer ID
				byzantine.getCoordinators(conn, objUnit.hp, objJoint.phase, function(err, proposer, round_index, witnesses){	
					if(err)
						return cb("error occured when getCoordinators err:" + err);		
					if(proposer !== objJoint.proposer[0].address)
						return cb("proposer incorrect,Expected: "+ proposer +" Actual :" + objJoint.proposer[0].address);
					if(round_index !== objUnit.round_index)
						return cb("proposer round_index incorrect ,Expected: "+ round_index +" Actual :" + objUnit.round_index);
					objValidationState.unit_hash_to_sign = objectHash.getProposalHashToSign(objUnit);
					//validate proposer signature
					validateProposer(conn, objJoint.proposer[0], objUnit, objValidationState, cb);
				});
			},
			function(cb){ // check timestamp is near to mine in data feed message 
			 	validateDataFeedMessage(conn, objUnit.messages[0], objUnit, objValidationState, cb);
			},
		], 
		function(err){
			if(!err){
				conn.query("COMMIT", function(){
					conn.release();
					callbacks.ifOk();
				});
			}
			else{
			//Error occured here
			conn.query("ROLLBACK", function(){
				conn.release();
				if (typeof err === "object"){
					if (err.error_code === "unresolved_dependency"){
						console.log(err.errorMessage);
						callbacks.ifNeedWaiting(err.errorMessage);
					}
					else
						throw Error("unknown error code");
				}
				else
					callbacks.ifInvalid(err);
				});
			}
			
		}
	); // async.series
	
}