本文整理汇总了Java中lucee.runtime.Component.getExtends方法的典型用法代码示例。如果您正苦于以下问题:Java Component.getExtends方法的具体用法?Java Component.getExtends怎么用?Java Component.getExtends使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucee.runtime.Component
的用法示例。
在下文中一共展示了Component.getExtends方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import lucee.runtime.Component; //导入方法依赖的package包/类
public static Struct call(PageContext pc , Component component) {
DeprecatedUtil.function(pc, "ComponentInfo", "GetMetaData");
Struct sct=new StructImpl();
sct.setEL(KeyConstants._name,component.getName());
sct.setEL(KeyConstants._fullname,component.getCallName());
String extend = component.getExtends();
if(extend==null || extend.length()==0)extend="Component";
sct.setEL(KeyConstants._extends,extend);
sct.setEL(KeyConstants._hint,component.getHint());
return sct;
}
示例2: call
import lucee.runtime.Component; //导入方法依赖的package包/类
public static Struct call(PageContext pc , Component component) {
DeprecatedUtil.function(pc, "ComponentInfo", "GetMetaData");
Struct sct=new StructImpl();
sct.setEL(KeyConstants._name,component.getName());
sct.setEL(KeyConstants._fullname,component.getCallName());
String extend = component.getExtends();
if(extend==null || extend.length()==0)extend="Component"; // TODO Object instead?
sct.setEL(KeyConstants._extends,extend);
sct.setEL(KeyConstants._hint,component.getHint());
return sct;
}
示例3: _getComponentPropertiesClass
import lucee.runtime.Component; //导入方法依赖的package包/类
private static Class _getComponentPropertiesClass(PageContext pc,Component component) throws PageException, IOException, ClassNotFoundException {
ASMProperty[] props = ASMUtil.toASMProperties(component.getProperties(false, true, false, false));
String className=getClassname(component,props);
String real=className.replace('.','/');
Mapping mapping = component.getPageSource().getMapping();
PhysicalClassLoader cl = (PhysicalClassLoader)((PageContextImpl)pc).getRPCClassLoader(false);
Resource classFile = cl.getDirectory().getRealResource(real.concat(".class"));
// get component class information
String classNameOriginal=component.getPageSource().getClassName();
String realOriginal=classNameOriginal.replace('.','/');
Resource classFileOriginal = mapping.getClassRootDirectory().getRealResource(realOriginal.concat(".class"));
// load existing class when pojo is still newer than component class file
if(classFile.lastModified()>=classFileOriginal.lastModified()) {
try {
Class clazz=cl.loadClass(className);
if(clazz!=null && !hasChangesOfChildren(classFile.lastModified(), clazz))return clazz;//ClassUtil.loadInstance(clazz);
}
catch(Throwable t) {ExceptionUtil.rethrowIfNecessary(t);}
}
// extends
String strExt = component.getExtends();
Class<?> ext=Object.class;
if(!StringUtil.isEmpty(strExt,true)) {
ext = Caster.cfTypeToClass(strExt);
}
//
// create file
byte[] barr = ASMUtil.createPojo(real, props,ext,new Class[]{Pojo.class},component.getPageSource().getDisplayPath());
ResourceUtil.touch(classFile);
IOUtil.copy(new ByteArrayInputStream(barr), classFile,true);
cl = (PhysicalClassLoader)((PageContextImpl)pc).getRPCClassLoader(true);
return cl.loadClass(className); //ClassUtil.loadInstance(cl.loadClass(className));
}
示例4: _getComponentPropertiesClass
import lucee.runtime.Component; //导入方法依赖的package包/类
private static Class _getComponentPropertiesClass(PageContext pc,Component component) throws PageException, IOException, ClassNotFoundException {
ASMProperty[] props = ASMUtil.toASMProperties(ComponentProUtil.getProperties(component, false, true, false, false));
String className=getClassname(component,props);//StringUtil.replaceLast(classNameOriginal,"$cfc","");
String real=className.replace('.','/');
Mapping mapping = component.getPageSource().getMapping();
PhysicalClassLoader cl = (PhysicalClassLoader)((PageContextImpl)pc).getRPCClassLoader(false);
Resource classFile = cl.getDirectory().getRealResource(real.concat(".class"));
// get component class information
String classNameOriginal=component.getPageSource().getFullClassName();
String realOriginal=classNameOriginal.replace('.','/');
Resource classFileOriginal = mapping.getClassRootDirectory().getRealResource(realOriginal.concat(".class"));
// load existing class when pojo is still newer than component class file
if(classFile.lastModified()>=classFileOriginal.lastModified()) {
try {
Class clazz=cl.loadClass(className);
if(clazz!=null && !hasChangesOfChildren(classFile.lastModified(), clazz))return clazz;//ClassUtil.loadInstance(clazz);
}
catch(Throwable t){
ExceptionUtil.rethrowIfNecessary(t);
}
}
// extends
String strExt = component.getExtends();
Class<?> ext=Object.class;
if(!StringUtil.isEmpty(strExt,true)) {
ext = Caster.cfTypeToClass(strExt);
}
//
// create file
byte[] barr = ASMUtil.createPojo(real, props,ext,new Class[]{Pojo.class},component.getPageSource().getDisplayPath());
ResourceUtil.touch(classFile);
IOUtil.copy(new ByteArrayInputStream(barr), classFile,true);
cl = (PhysicalClassLoader)((PageContextImpl)pc).getRPCClassLoader(true);
return cl.loadClass(className); //ClassUtil.loadInstance(cl.loadClass(className));
}