public String getString(int i) { Pro value = pros[i]; if (value == null) return null; return value.getString(); }
public String getString(int i, String defaultValue) { Pro value = pros[i]; if (value == null) return defaultValue; return value.getString(defaultValue); }
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; }