public Object getValue(ELContext context, Object base, Object property) {
checkBaseAndProperty(base, property);
if (base instanceof ResourceHandler) {
ResourceHandler handler = (ResourceHandler) base;
String prop = (String) property;
Resource resource;
if (!prop.contains(":")) {
resource = handler.createResource(prop);
} else {
String[] parts = prop.split(":");
if (parts.length != 2) {
throw new ELException(MessageFormat.format(
"Invalid resource format. Property {0} contains more than one colon (:)", prop));
}
resource = handler.createResource(parts[1], parts[0]);
}
context.setPropertyResolved(true);
if (resource != null) {