Ejemplo n.º 1
0
	public boolean getBoolean(int i, boolean defaultValue) {
		Pro value = pros[i];
		if (value == null)
			return defaultValue;
		boolean value_ = value.getBoolean(defaultValue);
		return value_;
	}
Ejemplo n.º 2
0
	public ProList getList(int i) {
		Pro value = pros[i];
		if (value == null)
			return null;

		return value.getList();
	}
Ejemplo n.º 3
0
	public String getString(int i) {
		Pro value = pros[i];
		if (value == null)
			return null;

		return value.getString();
	}
Ejemplo n.º 4
0
	public boolean getBoolean(int i) {
		Pro value = pros[i];
		if (value == null)
			return false;
		// boolean value_ = Boolean.parseBoolean(value.toString());
		return value.getBoolean();
	}
Ejemplo n.º 5
0
	public int getInt(int i, int defaultValue) {
		Pro value = pros[i];
		if (value == null)
			return defaultValue;
		// int value_ = Integer.parseInt(value.toString());
		return value.getInt();
	}
Ejemplo n.º 6
0
    /**
     * 获取方法的惟一标识
     * @return
     */
    public String getUUID()
    {
    	try
    	{
	    	if(uuid != null)
	    		return uuid;
	    	if(this.isPattern())
	    	{
	    		return this.uuid = this.pattern;
	    	}
	    		
	    	StringBuffer uuid_ = new StringBuffer();    	
	    	uuid_.append(this.methodName);
	    	if(this.params != null)
	    	{
	    		for(int i = 0; i < params.size(); i ++)
	    		{
	    			Pro param = (Pro)params.get(i);    			
	    			uuid_.append("_").append(param.getClazz());
	    		}
	    	}
	    	uuid = uuid_.toString();
	    	return uuid;
    	}
    	catch(Exception e)
    	{
    		log.error("",e);
    		return null;
    	}
    	
    }
Ejemplo n.º 7
0
	public ProSet getSet(int i, ProSet defaultValue) {
		Pro value = pros[i];

		if (value == null)
			return defaultValue;

		return value.getSet(defaultValue);
	}
Ejemplo n.º 8
0
	public String getString(int i, String defaultValue) {
		Pro value = pros[i];

		if (value == null)
			return defaultValue;

		return value.getString(defaultValue);
	}
Ejemplo n.º 9
0
	public Object getObject(int i, Object defaultValue) {
		Pro value = pros[i];

		if (value == null)
			return defaultValue;

		return value.getObject(defaultValue);
	}
Ejemplo n.º 10
0
	public Object getComponentArray(CallContext callcontext) {
		if (this.getComponentType() == null)
			return this;

		if (componentArray == null) {
			synchronized (lock) {
				if (componentArray == null) {
//					if (this.size() > 0) 
					{
						if (this.componentType.equalsIgnoreCase(Pro.COMPONENT_BEAN)) {
							Class enumType = this.pros[0].getBeanClass();

							// componentArray = new ArrayList(this.size());
							componentArray = Array.newInstance(enumType, this
									.size());
							int i = 0;
							if(pros != null)
							{
								Context currentLoopContext = callcontext != null?callcontext.getLoopContext():null;
								for (Pro v : this.pros) {
									try{
										Array.set(componentArray, i, v.getBean(callcontext));
									}
									finally
		    						{
		    							if(callcontext != null)
		    								callcontext.setLoopContext(currentLoopContext);
		    						}
									i++;
								}
							}
						} else if (this.componentType
								.equalsIgnoreCase(Pro.COMPONENT_STRING_SHORTNAME) || this.componentType
								.equalsIgnoreCase(Pro.COMPONENT_STRING)) {

							// componentArray = new ArrayList(this.size());
							componentArray = Array.newInstance(String.class,
									this.size());
							int i = 0;
							if(pros != null)
							{
								for (Pro v : this.pros) {
								Array.set(componentArray, i, v.getString());
								i++;
								}
							}
						}
						else if (this.componentType.equalsIgnoreCase(Pro.COMPONENT_OBJECT_SHORTNAME) || this.componentType.equalsIgnoreCase(Pro.COMPONENT_OBJECT)) {
							
							// componentArray = new ArrayList(this.size());
							componentArray = Array.newInstance(Object.class, this
									.size());
							int i = 0;
							if(pros != null)
							{
								Context currentLoopContext = callcontext != null?callcontext.getLoopContext():null;
								for (Pro v : this.pros) {
									try{
										Array.set(componentArray, i, v.getBean(callcontext));
									}
									finally
		    						{
		    							if(callcontext != null)
		    								callcontext.setLoopContext(currentLoopContext);
		    						}
									i++;
								}
							}
						}
						else if (this.componentType.equalsIgnoreCase(Pro.COMPONENT_CLASS) ) {
							
							// componentArray = new ArrayList(this.size());
							componentArray = Array.newInstance(Class.class, this
									.size());
							int i = 0;
							if(pros != null)
							{
								Context currentLoopContext = callcontext != null?callcontext.getLoopContext():null;
								for (Pro v : this.pros) {
								try{
									Object value = v.getBean(callcontext);
									Array.set(componentArray, i, ValueObjectUtil.typeCast(value, Class.class));
								}
								finally
	    						{
	    							if(callcontext != null)
	    								callcontext.setLoopContext(currentLoopContext);
	    						}
								i++;
								}
							}
						}						
						else {
							try {
								componentArray = Array.newInstance(ValueObjectUtil.getClass(componentType), this
										.size());
								int i = 0;
								if(pros != null)
								{
									Context currentLoopContext = callcontext != null?callcontext.getLoopContext():null;
									for (Pro v : this.pros) {
										try{
											Array.set(componentArray, i, v.getBean(callcontext));
										}
										finally
										{
											if(callcontext != null)
			    								callcontext.setLoopContext(currentLoopContext);
										}
									i++;
									}
								}
							} catch (NegativeArraySizeException e) {
								log.error(e.getMessage(),e);
								componentArray = this;
							} catch (ClassNotFoundException e) {
								log.error(e.getMessage(),e);
								componentArray = this;
							}
							catch (Exception e) {
								log.error(e.getMessage(),e);
								componentArray = this;
							}
							
							
						}
					}
//					else {
//						componentArray = this;
//					}
				}
			}
		}

		return componentArray;
	}
Ejemplo n.º 11
0
 public void addParam(Pro param)
 {
 	this.params.add(param);
 	this.paramIndexs.put(param.getClazz(), param);
 }