001 /**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.camel.component.bean;
018
019 import java.lang.annotation.Annotation;
020 import java.util.Arrays;
021
022 import org.apache.camel.Expression;
023
024 /**
025 * Parameter information to be used for method invocation.
026 *
027 * @version $Revision: 782977 $
028 */
029 public class ParameterInfo {
030 private final int index;
031 private final Class type;
032 private final Annotation[] annotations;
033 private Expression expression;
034
035 public ParameterInfo(int index, Class type, Annotation[] annotations, Expression expression) {
036 this.index = index;
037 this.type = type;
038 this.annotations = annotations;
039 this.expression = expression;
040 }
041
042 public Annotation[] getAnnotations() {
043 return annotations;
044 }
045
046 public Expression getExpression() {
047 return expression;
048 }
049
050 public int getIndex() {
051 return index;
052 }
053
054 public Class getType() {
055 return type;
056 }
057
058 public void setExpression(Expression expression) {
059 this.expression = expression;
060 }
061
062 @Override
063 public String toString() {
064 final StringBuilder sb = new StringBuilder();
065 sb.append("ParameterInfo");
066 sb.append("[index=").append(index);
067 sb.append(", type=").append(type);
068 sb.append(", annotations=").append(annotations == null ? "null" : Arrays.asList(annotations).toString());
069 sb.append(", expression=").append(expression);
070 sb.append(']');
071 return sb.toString();
072 }
073 }