/** * Return the descriptor for the item currently on top of the stack (in the current scope). */ @Nullable public String lastDescriptor() { return CollectionUtils.lastElement(this.compilationScopes.peek()); }
@Override @Nullable public AnnotationMetadata getImportingClassFor(String importedClass) { return CollectionUtils.lastElement(this.imports.get(importedClass)); }
/** * Return the descriptor for the item currently on top of the stack (in the current scope). */ @Nullable public String lastDescriptor() { return CollectionUtils.lastElement(this.compilationScopes.peek()); }
@Override @Nullable public AnnotationMetadata getImportingClassFor(String importedClass) { return CollectionUtils.lastElement(this.imports.get(importedClass)); }
@Override public String[] getPropertyNames() { List<String> names = new ArrayList<>(); for (OptionSpec<?> spec : this.source.specs()) { String lastOption = CollectionUtils.lastElement(spec.options()); if (lastOption != null) { // Only the longest name is used for enumerating names.add(lastOption); } } return StringUtils.toStringArray(names); }
@Override @Nullable public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer, NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception { Assert.state(mavContainer != null, "Errors/BindingResult argument only supported on regular handler methods"); ModelMap model = mavContainer.getModel(); String lastKey = CollectionUtils.lastElement(model.keySet()); if (lastKey != null && lastKey.startsWith(BindingResult.MODEL_KEY_PREFIX)) { return model.get(lastKey); } throw new IllegalStateException( "An Errors/BindingResult argument is expected to be declared immediately after " + "the model attribute, the @RequestBody or the @RequestPart arguments " + "to which they apply: " + parameter.getMethod()); }
@Override public String[] getPropertyNames() { List<String> names = new ArrayList<>(); for (OptionSpec<?> spec : this.source.specs()) { String lastOption = CollectionUtils.lastElement(spec.options()); if (lastOption != null) { // Only the longest name is used for enumerating names.add(lastOption); } } return StringUtils.toStringArray(names); }
@Override @Nullable public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer, NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception { Assert.state(mavContainer != null, "Errors/BindingResult argument only supported on regular handler methods"); ModelMap model = mavContainer.getModel(); String lastKey = CollectionUtils.lastElement(model.keySet()); if (lastKey != null && lastKey.startsWith(BindingResult.MODEL_KEY_PREFIX)) { return model.get(lastKey); } throw new IllegalStateException( "An Errors/BindingResult argument is expected to be declared immediately after " + "the model attribute, the @RequestBody or the @RequestPart arguments " + "to which they apply: " + parameter.getMethod()); }
return new ValueRef.TypedValueHolderValueRef(new TypedValue(CollectionUtils.lastElement(result)), this);
return new ValueRef.TypedValueHolderValueRef(new TypedValue(CollectionUtils.lastElement(result)), this);
/** * Return the descriptor for the item currently on top of the stack (in the current scope). */ @Nullable public String lastDescriptor() { return CollectionUtils.lastElement(this.compilationScopes.peek()); }
@Override @Nullable public AnnotationMetadata getImportingClassFor(String importedClass) { return CollectionUtils.lastElement(this.imports.get(importedClass)); }
@Override public String[] getPropertyNames() { List<String> names = new ArrayList<>(); for (OptionSpec<?> spec : this.source.specs()) { String lastOption = CollectionUtils.lastElement(spec.options()); if (lastOption != null) { // Only the longest name is used for enumerating names.add(lastOption); } } return StringUtils.toStringArray(names); }
@Override @Nullable public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer, NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception { Assert.state(mavContainer != null, "Errors/BindingResult argument only supported on regular handler methods"); ModelMap model = mavContainer.getModel(); String lastKey = CollectionUtils.lastElement(model.keySet()); if (lastKey != null && lastKey.startsWith(BindingResult.MODEL_KEY_PREFIX)) { return model.get(lastKey); } throw new IllegalStateException( "An Errors/BindingResult argument is expected to be declared immediately after " + "the model attribute, the @RequestBody or the @RequestPart arguments " + "to which they apply: " + parameter.getMethod()); }
@Override @Nullable public Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer, NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception { Assert.state(mavContainer != null, "Errors/BindingResult argument only supported on regular handler methods"); ModelMap model = mavContainer.getModel(); String lastKey = CollectionUtils.lastElement(model.keySet()); if (lastKey != null && lastKey.startsWith(BindingResult.MODEL_KEY_PREFIX)) { return model.get(lastKey); } throw new IllegalStateException( "An Errors/BindingResult argument is expected to be declared immediately after " + "the model attribute, the @RequestBody or the @RequestPart arguments " + "to which they apply: " + parameter.getMethod()); }
return new ValueRef.TypedValueHolderValueRef(new TypedValue(CollectionUtils.lastElement(result)), this);