File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java |
176 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
167 |
out.println(fieldPropName + " = " + propVar + ";");
out.unindent();
out.println("}");
}
public void writeSetPropertiesMethod(PrettyWriter out,
String componentClass,
ComponentBean component) throws IOException
{
Collection components = new HashSet();
components.add(component);
writeSetPropertiesMethod(out, componentClass, components);
}
public void writeSetPropertiesMethod(PrettyWriter out, String componentClass, Collection components)
throws IOException
{
Collection all = new HashSet();
for (Iterator lIterator = components.iterator(); lIterator.hasNext();)
{
ComponentBean component = (ComponentBean) lIterator.next();
Iterator prop = component.properties();
while (prop.hasNext())
{
all.add(prop.next());
}
}
Iterator properties = all.iterator();
properties = new FilteredIterator(properties, new TagAttributeFilter());
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateFaceletsTaglibsMojo.java |
129 |
org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateJspTaglibsMojo.java |
199 |
_writeEndTagLibrary(stream);
stream.close();
InputStream mergedStream = new ByteArrayInputStream(out.toByteArray());
// expand all the xi:include elements
SAXParserFactory saxFactory = SAXParserFactory.newInstance();
saxFactory.setNamespaceAware(true);
saxFactory.setValidating(false);
SAXParser saxParser = saxFactory.newSAXParser();
XMLReader mergedReader = saxParser.getXMLReader();
mergedReader = new XIncludeFilter(mergedReader, configFile.toURL());
// even with validating=false, DTD is still downloaded so that
// any entities contained in the document can be expanded.
// the following disables that behavior, also saving the time
// spent to parse the DTD
mergedReader.setEntityResolver(new EntityResolver()
{
public InputSource resolveEntity(
String publicId,
String systemId)
{
return new InputSource(new ByteArrayInputStream(new byte[0]));
}
});
InputSource mergedInput = new InputSource(mergedStream);
Source mergedSource = new SAXSource(mergedReader, mergedInput);
targetFile.delete();
targetFile.getParentFile().mkdirs();
Result mergedResult = new StreamResult(new FileOutputStream(targetFile));
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java |
535 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
593 |
out.println("\tAWTKeyStroke.getAWTKeyStroke(val));");
out.unindent();
out.unindent();
out.println("}");
out.unindent();
out.println("}");
}
else
{
out.println("if (" + propVar + " != null)");
out.println("{");
out.indent();
out.println("if (isValueReference(" + propVar + "))");
out.println("{");
out.indent();
out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
out.unindent();
out.println("}");
out.println("else");
out.println("{");
out.indent();
out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
out.println("\tAWTKeyStroke.getAWTKeyStroke(" + propVar + "));");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java |
62 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java |
62 |
imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
addImportsFromPropertes(validator, imports);
return imports;
}
protected void writeSetProperty(
PrettyWriter out,
PropertyBean property)
{
String propName = property.getPropertyName();
String propFullClass = property.getPropertyClass();
String propClass = Util.getClassFromFullClass(propFullClass);
String propVar = "_" + Util.getVariableFromName(propName);
out.println("if (" + propVar + " != null)");
out.println("{");
out.indent();
if (is12())
{
out.println("if (!" + propVar + ".isLiteralText())");
out.println("{");
out.indent();
out.println("validator.setValueExpression(\"" + propName + "\", " +
propVar + ");");
out.unindent();
out.println("}");
String propType = null;
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
746 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
833 |
String propName) throws IOException
{
String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
String propVar = "_" + propName;
out.println("if (" + propVar + " != null)");
out.println("{");
out.indent();
if (_is12)
{
out.println("if (!" + propVar + ".isLiteralText())");
out.println("{");
out.indent();
out.println("bean.setValueExpression(" + componentClass + "." + propKey + ", " + propVar + ");");
out.unindent();
out.println("}");
out.println("else");
out.println("{");
out.indent();
out.println("String s = " + propVar + ".getExpressionString();");
out.println("if (s != null)");
out.println("{");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java |
506 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
622 |
}
private void _writeSetKeyStroke(
PrettyWriter out,
String componentClass,
String propName) throws IOException
{
String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
String propVar = "_" + propName;
if (_is12)
{
out.println("if (" + propVar + " != null)");
out.println("{");
out.indent();
out.println("if (!" + propVar + ".isLiteralText())");
out.println("{");
out.indent();
out.println("bean.setValueExpression(" + componentClass + "." + propKey + ", " + propVar + ");");
out.unindent();
out.println("}");
out.println("else");
out.println("{");
out.indent();
out.println("String val = " + propVar + ".getExpressionString();");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java |
508 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
684 |
private void _writeSetAWTKeyStroke(
PrettyWriter out,
String componentClass,
String propName) throws IOException
{
String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
String propVar = "_" + propName;
if (_is12)
{
out.println("if (" + propVar + " != null)");
out.println("{");
out.indent();
out.println("if (!" + propVar + ".isLiteralText())");
out.println("{");
out.indent();
out.println("bean.setValueExpression(" + componentClass + "." + propKey + ", " + propVar + ");");
out.unindent();
out.println("}");
out.println("else");
out.println("{");
out.indent();
out.println("String val = " + propVar + ".getExpressionString();");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java |
32 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java |
32 |
public TrinidadConverterTagGenerator(boolean is12, String licenseHeader, Log log) {
super(is12, licenseHeader, log);
}
protected Set createImports(ConverterBean converter) {
Set imports = new TreeSet();
if (is12())
{
imports.add("javax.faces.webapp.ConverterELTag");
imports.add("javax.faces.context.FacesContext");
imports.add("javax.faces.application.Application");
}
else
{
imports.add("javax.faces.webapp.ConverterTag");
}
imports.add("javax.servlet.jsp.JspException");
imports.add(converter.getConverterClass());
imports.add("javax.faces.convert.Converter");
if (is12())
{
imports.add("javax.el.ValueExpression");
}
else
{
imports.add("javax.faces.el.ValueBinding");
}
imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java |
300 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java |
356 |
Util.getBoxedClass(property.getPropertyClass())+".valueOf(" + propVar + "));");
}else{
String propertyClass = property.getPropertyClass().trim();
if (propertyClass.startsWith("java.lang.")){
propertyClass = propertyClass.replace("java.lang.", "");
}
if (propertyClass.endsWith("eger")){
propertyClass = propertyClass.replace("eger", "");
}
if (Util.isPrimitiveClass(propertyClass.toLowerCase())){
out.println("comp.getAttributes().put(\"" + propName + "\", " +
Util.getBoxedClass(propertyClass.toLowerCase())+".valueOf(" + propVar + "));");
}else{
out.println("comp.getAttributes().put(\"" + propName + "\", " + propVar + ");");
}
}
}
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java |
108 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java |
103 |
out.println("validator." + setMethod + "(value);");
if ("StringArray".equals(propType))
{
out.println("}");
out.println("catch (ParseException pe)");
out.println("{");
out.indent();
out.println("throw new JspException(");
out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
out.unindent();
out.println("}");
}
out.unindent();
out.println("}");
}
}
else
{
out.println("if (TagUtils.isValueReference(" + propVar + "))");
out.println("{");
out.indent();
out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
out.println("validator.setValueBinding(\"" + propName + "\", vb);");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java |
86 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java |
133 |
out.println("validator.setValueBinding(\"" + propName + "\", vb);");
out.unindent();
out.println("}");
String propType = null;
if ("Date".equals (propClass))
{
propType = resolveDateType(propFullClass, property.getUseMaxTime());
}
else
{
propType = resolveType(propFullClass);
}
if (propType != null)
{
out.println("else");
out.println("{");
out.indent();
if ("StringArray".equals(propType))
{
out.println("try");
out.println("{");
}
out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java |
65 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java |
65 |
addImportsFromPropertes(validator, imports);
return imports;
}
protected void writeSetProperty(
PrettyWriter out,
PropertyBean property)
{
String propName = property.getPropertyName();
String propFullClass = property.getPropertyClass();
String propClass = Util.getClassFromFullClass(propFullClass);
String propVar = "_" + Util.getVariableFromName(propName);
out.println("if (" + propVar + " != null)");
out.println("{");
out.indent();
if (is12())
{
out.println("if (!" + propVar + ".isLiteralText())");
out.println("{");
out.indent();
out.println("validator.setValueExpression(\"" + propName + "\", " +
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java |
90 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java |
85 |
out.println("validator.setValueExpression(\"" + propName + "\", " +
propVar + ");");
out.unindent();
out.println("}");
String propType = resolveType(propFullClass);
if (propType != null)
{
out.println("else");
out.println("{");
out.indent();
if ("StringArray".equals(propType))
{
out.println("try");
out.println("{");
}
out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
String setMethod = Util.getPrefixedPropertyName("set", propName);
out.println("validator." + setMethod + "(value);");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
787 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java |
861 |
out.println("bean.setProperty(" + componentClass + "." + propKey + ", converter);");
out.unindent();
out.println("}");
out.unindent();
out.println("}");
}
else
{
out.println("if (isValueReference(" + propVar + "))");
out.println("{");
out.indent();
out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
out.unindent();
out.println("}");
out.println("else");
out.println("{");
out.indent();
out.println("Converter converter = getFacesContext().getApplication().");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java |
125 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java |
130 |
out.println("converter.setValueBinding(\"" + propName + "\", vb);");
out.unindent();
out.println("}");
String propType = resolveType(propFullClass);
if (propType != null)
{
out.println("else");
out.println("{");
out.indent();
if ("StringArray".equals(propType))
{
out.println("try");
out.println("{");
}
out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
String setMethod = Util.getPrefixedPropertyName("set", propName);
out.println("converter." + setMethod + "(value);");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java |
33 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java |
33 |
super(_is12, _licenseHeader, _log);
}
protected Set createImports(ValidatorBean validator) {
Set imports = new TreeSet();
if (is12())
{
imports.add("javax.faces.webapp.ValidatorELTag");
imports.add("javax.faces.context.FacesContext");
imports.add("javax.faces.application.Application");
}
else
{
imports.add("javax.faces.webapp.ValidatorTag");
}
imports.add("javax.servlet.jsp.JspException");
imports.add(validator.getValidatorClass());
imports.add("javax.faces.validator.Validator");
if (is12())
{
imports.add("javax.el.ValueExpression");
}
else
{
imports.add("javax.faces.el.ValueBinding");
}
imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
|
File |
Line |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java |
130 |
org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java |
125 |
out.println("validator.setValueBinding(\"" + propName + "\", vb);");
out.unindent();
out.println("}");
String propType = resolveType(propFullClass);
if (propType != null)
{
out.println("else");
out.println("{");
out.indent();
if ("StringArray".equals(propType))
{
out.println("try");
out.println("{");
}
out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
String setMethod = Util.getPrefixedPropertyName("set", propName);
out.println("validator." + setMethod + "(value);");
|