xapi.ui.html.X_Html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xapi-dev Show documentation
Show all versions of xapi-dev Show documentation
Everything needed to run a comprehensive dev environment.
Just type X_ and pick a service from autocomplete;
new dev modules will be added as they are built.
The only dev service not included in the uber jar is xapi-dev-maven,
as it includes all runtime dependencies of maven, adding ~4 seconds to build time,
and 6 megabytes to the final output jar size (without xapi-dev-maven, it's ~1MB).
The newest version!
package xapi.ui.html;
import xapi.inject.X_Inject;
import xapi.ui.api.StyleService;
import xapi.ui.html.api.HtmlService;
import xapi.ui.html.api.HtmlSnippet;
public class X_Html {
private X_Html() {}
@SuppressWarnings({ "unchecked", "rawtypes" })
public static String toHtml(Class template, Class cls, T o, StyleService context) {
return toSnippet(template, (Class)cls, context).convert(o);
}
public static String toHtml(Class cls, T o, StyleService context) {
return toHtml(cls, cls, o, context);
}
public static HtmlSnippet toSnippet(Class cls, StyleService context) {
return toSnippet(cls, cls, context);
}
public static HtmlSnippet toSnippet(Class templateClass, Class cls, StyleService context) {
return X_Inject.singleton(HtmlService.class).toSnippet(templateClass, cls, context);
}
public static void injectCss(final Class cls, StyleService context) {
X_Inject.singleton(HtmlService.class).injectStyle(cls, context);
}
}