本文整理汇总了Java中org.apache.tapestry5.ioc.internal.util.InternalUtils类的典型用法代码示例。如果您正苦于以下问题:Java InternalUtils类的具体用法?Java InternalUtils怎么用?Java InternalUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InternalUtils类属于org.apache.tapestry5.ioc.internal.util包,在下文中一共展示了InternalUtils类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transform
import org.apache.tapestry5.ioc.internal.util.InternalUtils; //导入依赖的package包/类
public InputStream transform(final Resource source, final ResourceDependencies dependencies) throws IOException {
InputStream is = null;
String content;
try {
is = source.openStream();
content = IOUtils.toString(is, UTF8);
} finally {
InternalUtils.close(is);
}
RhinoExecutor executor = executorPool.get();
String fileName = source.getFile();
if (fileName != null && fileName.endsWith(".ts")) {
}
try {
NativeObject result = (NativeObject) executor.invokeFunction("transpile", content, source.toString(),
"{noEmitOnError: true, noImplicitAny: true,target: ts.ScriptTarget.ES6, module: ts.ModuleKind.CommonJS}");
if (result.containsKey("exception")) {
throw new RuntimeException(getString(result, "exception"));
}
return IOUtils.toInputStream(getString(result, "output"), UTF8);
} finally {
executor.discard();
}
}
示例2: extractLocationFromAnnotation
import org.apache.tapestry5.ioc.internal.util.InternalUtils; //导入依赖的package包/类
private String[] extractLocationFromAnnotation(Class<?> clazz) {
ContextConfiguration contextConfiguration = InternalUtils.findAnnotation(clazz.getAnnotations(),
ContextConfiguration.class);
String[] locations = null;
if (contextConfiguration != null) {
locations = contextConfiguration.locations();
}
return locations;
}