use of com.sun.enterprise.tools.verifier.web.FunctionDescriptor in project Payara by payara.
the class TagLibDescriptor method getFunctionDescriptors.
/**
* for each functions in tag lib descriptor creates a function descritor and
* return the array of FunctionDescriptors
* @return array of function descriptor.
*/
public FunctionDescriptor[] getFunctionDescriptors() {
NodeList nl = doc.getElementsByTagName(FUNCTION);
List<FunctionDescriptor> list = new ArrayList<FunctionDescriptor>();
if (nl != null) {
int size = nl.getLength();
for (int i = 0; i < size; i++) {
list.add(new FunctionDescriptor(nl.item(i)));
}
}
return list.toArray(new FunctionDescriptor[0]);
}
use of com.sun.enterprise.tools.verifier.web.FunctionDescriptor in project Payara by payara.
the class TaglibFunctionMethodTest method check.
public Result check(WebBundleDescriptor descriptor) {
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
Result result = getInitializedResult();
VerifierTestContext context = getVerifierContext();
TagLibDescriptor[] tlds = context.getTagLibDescriptors();
FunctionDescriptor[] fnDesc = null;
if (tlds == null) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName() + ".passed", "No tag lib files are specified"));
return result;
}
for (TagLibDescriptor tld : tlds) {
if (tld.getSpecVersion().compareTo("2.0") >= 0) {
fnDesc = tld.getFunctionDescriptors();
if (fnDesc != null)
for (FunctionDescriptor fd : fnDesc) checkMethodExistence(result, fd, tld, compName);
}
}
if (result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName() + ".passed", "All methods defined in the function-signature element" + "of the tag lib descriptor are properly defined."));
}
return result;
}
use of com.sun.enterprise.tools.verifier.web.FunctionDescriptor in project Payara by payara.
the class TaglibFunctionSignatureIsValid method check.
public Result check(WebBundleDescriptor descriptor) {
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
Result result = getInitializedResult();
VerifierTestContext context = getVerifierContext();
TagLibDescriptor[] tlds = context.getTagLibDescriptors();
FunctionDescriptor[] fnDesc = null;
if (tlds == null) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName() + ".passed", "No tag lib files are specified"));
return result;
}
for (TagLibDescriptor tld : tlds) {
if (tld.getSpecVersion().compareTo("2.0") >= 0) {
fnDesc = tld.getFunctionDescriptors();
if (fnDesc != null)
for (FunctionDescriptor fd : fnDesc) checkSignature(result, fd, tld, compName);
}
}
if (result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName() + ".passed", "function-signature element of the tag lib " + "descriptor are properly defined."));
}
return result;
}
Aggregations