當前位置: 首頁>>代碼示例>>Java>>正文


Java Component.getExtends方法代碼示例

本文整理匯總了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;
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:13,代碼來源:ComponentInfo.java

示例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;
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:13,代碼來源:ComponentInfo.java

示例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));
	}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:41,代碼來源:ComponentUtil.java

示例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));
	}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:43,代碼來源:ComponentUtil.java


注:本文中的lucee.runtime.Component.getExtends方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。