Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
License Agreement. Rich Faces - Natural Ajax for Java Server Faces (JSF) Copyright (C) 2007 Exadel, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 package org.ajax4jsf.templatecompiler.el;
 

Author(s):
yukhovich
 
 public class CompiledEL implements ICompiledEL {
 
 	class containedClass {
 		private Class type;
 
 		private String code;
 
 		public containedClass(String codeClass type) {
 			this. = code;
 			this. = type;
 		}
 
 		public Class getType() {
 			return this.;
 		}
 
 		public String getCode() {
 			return this.;
 		}
 
 	}
 
 	private ArrayList childs = new ArrayList();
 
 	private Class type;
 
 	private String code;
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.ajax4jsf.templatecompiler.el.ICompiledEL#getJavaCode()
 	 */
 	public String getJavaCode() {
 		int i = 0;
 
 		ArrayList tmp = new ArrayList();
 		boolean bString = false;
 
 		for (Iterator iter = this..iterator(); iter.hasNext(); i++) {
 			ICompiledEL element = (ICompiledELiter.next();
 
 			String tmpCode = element.getJavaCode();
 
 			if (null != element.getType()) {
 				if (String.class.isAssignableFrom(element.getType())) {
 					bString = true;
 				}
 
 				tmp.add(new containedClass(tmpCodeelement.getType()));
 			}
 		}
 
 		if (null != this.) {
 
 			if (String.class.isAssignableFrom(this.)) {
 				bString = true;
 			}
 
 			tmp.add(new containedClass(this.this.));
 		}
 
 		StringBuffer buf = new StringBuffer();
 
 		for (Iterator iter = tmp.iterator(); iter.hasNext();) {
 			containedClass element = (containedClassiter.next();
 
 			if (String.class.isAssignableFrom(element.getType())) {
 				buf.append(element.getCode());
else {
				if (bString) {
					buf.append("ConvertToString(").append(element.getCode())
							.append(")");
				}
			}
			if (iter.hasNext()) {
				buf.append(" + ");
			}
		}
		if (bString) {
			this. = String.class;
else {
			this. = Object.class;
		}
		return buf.toString();
	}
	public void addChild(ICompiledEL child) {
		this..add(child);
	}
	public void setJavaCode(String string) {
		setJavaCode(stringjava.lang.String.class);
	}
	public void setJavaCode(String stringClass type) {
		this. = string;
		this. = type;
	}
	public void setString(String str) {
		setJavaCode("\"" + str + "\"");
	}
	public Class getType() {
		return this.;
	}
New to GrepCode? Check out our FAQ X