/** * Gets the client-side package for the type, type declaration, package, or their string values. * * @param list The arguments. * @return The string value of the client-side package. */ public Object exec(List list) throws TemplateModelException { if (list.size() < 1) { throw new TemplateModelException("The convertPackage method must have the class or package as a parameter."); } Object unwrapped = unwrap(list.get(0)); return convertUnwrappedObject(unwrapped); }
@Override public String convertUnwrappedObject(Object unwrapped) throws TemplateModelException { if (unwrapped instanceof Accessor) { return convert((Accessor) unwrapped); } else if (unwrapped instanceof ImplicitChildElement) { return convert((ImplicitChildElement) unwrapped); } else { return super.convertUnwrappedObject(unwrapped); } }
/** * Gets the client-side package for the type, type declaration, package, or their string values. * * @param list The arguments. * @return The string value of the client-side package. */ public Object exec(List list) throws TemplateModelException { if (list.size() < 1) { throw new TemplateModelException("The convertPackage method must have the class or package as a parameter."); } TemplateModel from = (TemplateModel) list.get(0); Object unwrapped = BeansWrapper.getDefaultInstance().unwrap(from); return convertUnwrappedObject(unwrapped); }
@Override public String convertUnwrappedObject(Object unwrapped) throws TemplateModelException { if (unwrapped instanceof Accessor) { return convert((Accessor) unwrapped); } else if (unwrapped instanceof ImplicitChildElement) { return convert((ImplicitChildElement) unwrapped); } else if (unwrapped instanceof TypeParameterDeclaration) { return convert((TypeParameterDeclaration) unwrapped); } else { return super.convertUnwrappedObject(unwrapped); } }