writer.write("\n\n");
}
private void writeAttributes(BufferedWriter writer, Component component) throws IOException {
for (Iterator attributeIterator = component.getAttributes().iterator(); attributeIterator.hasNext();) {
Attribute attribute = (Attribute) attributeIterator.next();
if(attribute.isIgnored())
continue;
if(isMethodBinding(attribute)) {
writeMethodBindingAttribute(writer, attribute);
} else {
//TODO:Make below a method
writer.write("\tpublic " + attribute.getShortTypeName() + " " + resolveGetterPrefix(attribute) + attribute.getCapitalizedName() + "() {\n");
writer.write("\t\tif(_" + attribute.getName() + " != null )\n");
writer.write("\t\t\treturn _" + attribute.getName() + FacesMojoUtils.getPrimitiveMethod(attribute.getShortTypeName()) + ";\n");
writer.write("\n");
writer.write("\t\tValueBinding vb = getValueBinding(\"" + attribute.getName() + "\");\n");
writer.write("\t\treturn vb != null ? " + getVBResolverCode(attribute.getType()) + " : " + attribute.getDefaultValue() + ";\n");
writer.write("\t}\n");
writer.write("\tpublic void set" + attribute.getCapitalizedName() + "(" + attribute.getShortTypeName() + " " + attribute.getName() + "Value) {\n");
if(!FacesMojoUtils.shouldWrap(attribute.getType()))
writer.write("\t\t_" + attribute.getName() + " = " + attribute.getName() + "Value;\n");
else
writer.write("\t\t_" + attribute.getName() + " = new " +
FacesMojoUtils.getWrapperType(attribute.getShortTypeName()) + "(" + attribute.getName() + "Value);\n");
writer.write("\t}\n\n");
}
}
}