System.out.println("proxy.getElement(a).isCollection() " + a);
} else {
ConfigModel.Node node = (ConfigModel.Node) prop;
//String childbeanName = getBeanName(a);
ConfigModel childModel = node.getModel();
String getterName = getBeanName(a);
System.out.println("Model.targetTypeName" + model.targetTypeName);
System.out.println("newModel.targetTypeName" + childModel.targetTypeName);
System.out.println("ConfigModel.Node node isCollection=" + prop.isCollection());
System.out.println("ConfigModel.Node node isLeaf=" + prop.isLeaf());
System.out.println("ConfigModel.Node node xlmname=" + prop.xmlName());
if (childModel.targetTypeName.endsWith("Named")) {
a = "application";
getterName = "Applications";
try {
Class<?> subType = childModel.classLoaderHolder.get().loadClass(childModel.targetTypeName); /// a shoulf be the typename
List<ConfigModel> lcm = document.getAllModelsImplementing(subType);
if (lcm != null) {
for (ConfigModel childmodel : lcm) {
System.out.println("***childmodel.targetTypeName" + childmodel.targetTypeName);
if (childmodel.targetTypeName.equals("com.sun.enterprise.config.serverbeans.Application")) {
childModel = childmodel;
}
}
}
} catch (Exception e) {
Logger.getLogger(GeneratorResource.class.getName()).log(Level.SEVERE, e.getMessage());
}
}
String childbeanName = childModel.targetTypeName.substring(childModel.targetTypeName.lastIndexOf(".") + 1,
childModel.targetTypeName.length());
if (!childModel.targetTypeName.endsWith("Resource")) {
String prefix = "";
if (prop.isCollection()) {
prefix = "List";
}
if (a.equals("*")) {
getterName = childbeanName + "s";
}
out.write("\t@Path(\"" + childModel.getTagName() + "/\")\n");
out.write("\tpublic " + prefix + childbeanName + "Resource get" + childbeanName + "Resource() {\n");
out.write("\t\t" + prefix + childbeanName + "Resource resource = resourceContext.getResource(" + prefix + childbeanName + "Resource.class);\n");
out.write("\t\tresource.setEntity(getEntity().get" + getterName + "() );\n");
out.write("\t\treturn resource;\n");