Package org.hibernate.validator.internal.metadata.raw

Examples of org.hibernate.validator.internal.metadata.raw.ExecutableElement


    public boolean accepts(ConstrainedElement constrainedElement) {
      if ( kind != constrainedElement.getKind() ) {
        return false;
      }

      ExecutableElement executableElement = ( (ConstrainedExecutable) constrainedElement ).getLocation()
          .getExecutableElement();

      //are the locations equal (created by different builders) or
      //does one of the executables override the other one?
      return
          location.getExecutableElement().equals( executableElement ) ||
              location.getExecutableElement().overrides( executableElement ) ||
              executableElement.overrides(
                  location.getExecutableElement()
              );
    }
View Full Code Here


    @Override
    public ExecutableMetaData build() {
      assertCorrectnessOfConfiguration();

      ExecutableElement executableElement = location.getExecutableElement();

      return new ExecutableMetaData(
          executableElement.getSimpleName(),
          executableElement.getReturnType(),
          executableElement.getParameterTypes(),
          kind == ConstrainedElement.ConstrainedElementKind.CONSTRUCTOR ? ElementKind.CONSTRUCTOR : ElementKind.METHOD,
          adaptOriginsAndImplicitGroups( getConstraints() ),
          findParameterMetaData(),
          adaptOriginsAndImplicitGroups( crossParameterConstraints ),
          getGroupConversions(),
          isCascading(),
          isConstrained,
          executableElement.isGetterMethod()
      );
    }
View Full Code Here

      }
      else {
        alreadyProcessedMethods.add( method );
      }

      ExecutableElement methodExecutableElement = ExecutableElement.forMethod( method );

      // ignore annotations
      if ( methodType.getIgnoreAnnotations() != null ) {
        annotationProcessingOptions.ignoreConstraintAnnotationsOnMember(
            method,
View Full Code Here

      }
      else {
        alreadyProcessedConstructors.add( constructor );
      }

      ExecutableElement constructorExecutableElement = ExecutableElement.forConstructor( constructor );

      // ignore annotations
      if ( constructorType.getIgnoreAnnotations() != null ) {
        annotationProcessingOptions.ignoreConstraintAnnotationsOnMember(
            constructor,
View Full Code Here

    public boolean accepts(ConstrainedElement constrainedElement) {
      if ( kind != constrainedElement.getKind() ) {
        return false;
      }

      ExecutableElement executableElement = ( (ConstrainedExecutable) constrainedElement ).getLocation()
          .getExecutableElement();

      //are the locations equal (created by different builders) or
      //does one of the executables override the other one?
      return
View Full Code Here

    @Override
    public ExecutableMetaData build() {
      assertCorrectnessOfConfiguration();

      ExecutableElement executableElement = location.getExecutableElement();

      return new ExecutableMetaData(
          executableElement.getSimpleName(),
          executableElement.getReturnType(),
          executableElement.getParameterTypes(),
          kind == ConstrainedElement.ConstrainedElementKind.CONSTRUCTOR ? ElementKind.CONSTRUCTOR : ElementKind.METHOD,
          adaptOriginsAndImplicitGroups( getConstraints() ),
          findParameterMetaData(),
          adaptOriginsAndImplicitGroups( crossParameterConstraints ),
          getGroupConversions(),
          isCascading(),
          isConstrained,
          executableElement.isGetterMethod()
      );
    }
View Full Code Here

  private <T> int validateParametersForGroup(MethodValidationContext<T> validationContext, T object, Object[] parameterValues, Group group) {

    int numberOfViolationsBefore = validationContext.getFailingConstraints().size();

    ExecutableElement executable = validationContext.getExecutable();

    BeanMetaData<T> beanMetaData = beanMetaDataManager.getBeanMetaData( validationContext.getRootBeanClass() );
    ExecutableMetaData methodMetaData = beanMetaData.getMetaDataFor( executable );

    // TODO GM: define behavior with respect to redefined default sequences. Should only the
View Full Code Here

  //TODO GM: if possible integrate with validateParameterForGroup()
  private <T, V> int validateReturnValueForGroup(MethodValidationContext<T> validationContext, T bean, V value, Group group) {

    int numberOfViolationsBefore = validationContext.getFailingConstraints().size();

    ExecutableElement executable = validationContext.getExecutable();

    BeanMetaData<T> beanMetaData = beanMetaDataManager.getBeanMetaData( validationContext.getRootBeanClass() );
    ExecutableMetaData executableMetaData = beanMetaData.getMetaDataFor( executable );

    // TODO GM: define behavior with respect to redefined default sequences. Should only the
View Full Code Here

      crossParameterConstraints.addAll( constrainedExecutable.getCrossParameterConstraints() );
    }

    @Override
    public ExecutableMetaData build() {
      ExecutableElement executableElement = location.getExecutableElement();

      return new ExecutableMetaData(
          executableElement.getSimpleName(),
          executableElement.getReturnType(),
          executableElement.getParameterTypes(),
          kind == ConstrainedElementKind.CONSTRUCTOR ? ConstraintMetaDataKind.CONSTRUCTOR : ConstraintMetaDataKind.METHOD,
          adaptOriginsAndImplicitGroups( location.getBeanClass(), getConstraints() ),
          findParameterMetaData(),
          crossParameterConstraints,
          checkParameterConstraints(),
View Full Code Here

    public boolean accepts(ConstrainedElement constrainedElement) {
      if ( kind != constrainedElement.getKind() ) {
        return false;
      }

      ExecutableElement executableElement = ( (ConstrainedExecutable) constrainedElement ).getLocation()
          .getExecutableElement();

      //are the locations equal (created by different builders) or
      //does one of the executables override the other one?
      return
          location.getExecutableElement().equals( executableElement ) ||
              location.getExecutableElement().overrides( executableElement ) ||
              executableElement.overrides(
                  location.getExecutableElement()
              );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.internal.metadata.raw.ExecutableElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.