Tabnine Logo
Log.getAttemptToSpecifyAnArrayWhereSingleValueIsExpectedException
Code IndexAdd Tabnine to your IDE (free)

How to use
getAttemptToSpecifyAnArrayWhereSingleValueIsExpectedException
method
in
org.hibernate.validator.internal.util.logging.Log

Best Java code snippets using org.hibernate.validator.internal.util.logging.Log.getAttemptToSpecifyAnArrayWhereSingleValueIsExpectedException (Showing top 3 results out of 315)

origin: org.hibernate.validator/hibernate-validator

protected <A extends Annotation> Object getElementValue(List<String> parsedParameters, Class<A> annotationClass, String name, String defaultPackage) {
  List<String> parameters = removeEmptyContentElements( parsedParameters );
  Class<?> returnType = getAnnotationParameterType( annotationClass, name );
  boolean isArray = returnType.isArray();
  if ( !isArray ) {
    if ( parameters.size() == 0 ) {
      return "";
    }
    else if ( parameters.size() > 1 ) {
      throw LOG.getAttemptToSpecifyAnArrayWhereSingleValueIsExpectedException();
    }
    return convertStringToReturnType( parameters.get( 0 ), returnType, defaultPackage );
  }
  else {
    return parameters.stream().map( value -> convertStringToReturnType( value, returnType.getComponentType(), defaultPackage ) )
        .toArray( size -> (Object[]) Array.newInstance( returnType.getComponentType(), size ) );
  }
}
origin: org.hibernate.validator/hibernate-validator

@SuppressWarnings("unchecked")
protected <A extends Annotation> Object getAnnotationElementValue(List<AnnotationParameterStaxBuilder> parameters, Class<A> annotationClass, String name, String defaultPackage) {
  Class<?> returnType = getAnnotationParameterType( annotationClass, name );
  boolean isArray = returnType.isArray();
  if ( !isArray ) {
    if ( parameters.size() == 0 ) {
      throw LOG.getEmptyElementOnlySupportedWhenCharSequenceIsExpectedExpection();
    }
    else if ( parameters.size() > 1 ) {
      throw LOG.getAttemptToSpecifyAnArrayWhereSingleValueIsExpectedException();
    }
    return parameters.get( 0 ).build( (Class<Annotation>) returnType, defaultPackage );
  }
  else {
    return parameters.stream().map( value -> value.build( (Class<Annotation>) returnType.getComponentType(), defaultPackage ) )
        .toArray( size -> (Object[]) Array.newInstance( returnType.getComponentType(), size ) );
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.hibernate-validator

private Object getElementValue(ElementType elementType, Class<?> returnType, String defaultPackage) {
  removeEmptyContentElements( elementType );
  boolean isArray = returnType.isArray();
  if ( !isArray ) {
    if ( elementType.getContent().size() == 0 ) {
      if ( returnType == String.class ) {
        return "";
      }
      else {
        throw log.getEmptyElementOnlySupportedWhenCharSequenceIsExpectedExpection();
      }
    }
    else if ( elementType.getContent().size() > 1 ) {
      throw log.getAttemptToSpecifyAnArrayWhereSingleValueIsExpectedException();
    }
    return getSingleValue( elementType.getContent().get( 0 ), returnType, defaultPackage );
  }
  else {
    List<Object> values = newArrayList();
    for ( Serializable s : elementType.getContent() ) {
      values.add( getSingleValue( s, returnType.getComponentType(), defaultPackage ) );
    }
    return values.toArray( (Object[]) Array.newInstance( returnType.getComponentType(), values.size() ) );
  }
}
org.hibernate.validator.internal.util.loggingLoggetAttemptToSpecifyAnArrayWhereSingleValueIsExpectedException

Popular methods of Log

  • getInvalidRegularExpressionException
  • getInvalidLengthForFractionPartException
  • getInvalidLengthForIntegerPartException
  • getLengthCannotBeNegativeException
  • getMaxCannotBeNegativeException
  • getMinCannotBeNegativeException
  • debug
  • debugf
  • errorInExpressionLanguage
  • evaluatingExpressionLanguageExpressionCausedException
  • getAnnotationDoesNotContainAParameterException
  • getAtLeastOneCustomMessageMustBeCreatedException
  • getAnnotationDoesNotContainAParameterException,
  • getAtLeastOneCustomMessageMustBeCreatedException,
  • getAtLeastOneGroupHasToBeSpecifiedException,
  • getBeanClassHasAlreadyBeConfiguredViaProgrammaticApiException,
  • getBeanClassMustBePartOfRedefinedDefaultGroupSequenceException,
  • getBeanDoesNotContainConstructorException,
  • getBeanDoesNotContainMethodException,
  • getBeanDoesNotContainTheFieldException,
  • getBeanDoesNotContainThePropertyException

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now