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


Java Component.containsKey方法代碼示例

本文整理匯總了Java中lucee.runtime.Component.containsKey方法的典型用法代碼示例。如果您正苦於以下問題:Java Component.containsKey方法的具體用法?Java Component.containsKey怎麽用?Java Component.containsKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在lucee.runtime.Component的用法示例。


在下文中一共展示了Component.containsKey方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: call

import lucee.runtime.Component; //導入方法依賴的package包/類
public Object call(String cfcPath,String id,String functionName,Struct arguments, boolean cfcPeristent, Object defaultValue) throws PageException  {
	String requestURI=toRequestURI(cfcPath);
	
	PageContext oldPC = ThreadLocalPageContext.get();
	PageContextImpl pc=createPageContext(requestURI,id,functionName,arguments,cfcPeristent);
	
	try {
		ThreadLocalPageContext.register(pc);
		Component cfc=getCFC(pc,requestURI);
		if(cfc.containsKey(functionName)){
			pc.execute(requestURI, true,false);
			// Result
			return pc.variablesScope().get(AMF_FORWARD,null);
		}
	}
	finally{
		CFMLFactory f = config.getFactory();
		f.releasePageContext(pc);
		ThreadLocalPageContext.register(oldPC);
	}
	return defaultValue;
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:23,代碼來源:GatewayEngineImpl.java

示例2: setPropeties

import lucee.runtime.Component; //導入方法依賴的package包/類
public static void setPropeties(PageContext pc, Component cfc, Struct properties, boolean ignoreNotExisting) throws PageException { 
	if(properties==null) return;
	
	// argumentCollection
	if(properties.size()==1 && properties.containsKey(KeyConstants._argumentCollection) && !cfc.containsKey(KeyConstants._setArgumentCollection)) {
		properties=Caster.toStruct(properties.get(KeyConstants._argumentCollection));
	}
	
	Iterator<Entry<Key, Object>> it = properties.entryIterator();
	Entry<Key, Object> e;
	while(it.hasNext()){
		e = it.next();
		if(ignoreNotExisting) {
			try {
				cfc.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
			}
			catch(Throwable t){
				ExceptionUtil.rethrowIfNecessary(t);
			}
		}
		else {
			cfc.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
		}
	}
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:26,代碼來源:EntityNew.java

示例3: onApplicationEnd

import lucee.runtime.Component; //導入方法依賴的package包/類
@Override
public void onApplicationEnd(CFMLFactory factory, String applicationName) throws PageException {
	Component app = apps.get(applicationName);
	if(app==null || !app.containsKey(ON_APPLICATION_END)) return;
	
	PageContextImpl pc=(PageContextImpl) ThreadLocalPageContext.get();
	boolean createPc=pc==null;
	try {
		if(createPc)pc =  createPageContext(factory,app,applicationName,null,ON_APPLICATION_END,true,-1);
		call(app,pc, ON_APPLICATION_END, new Object[]{pc.applicationScope()},true);
	}
	finally {
		if(createPc && pc!=null){
			factory.releaseLuceePageContext(pc,createPc);
		}
	}
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:18,代碼來源:ModernAppListener.java

示例4: onSessionEnd

import lucee.runtime.Component; //導入方法依賴的package包/類
@Override
public void onSessionEnd(CFMLFactory factory, String applicationName, String cfid) throws PageException {
	Component app = apps.get(applicationName);
	if(app==null || !app.containsKey(ON_SESSION_END)) return;
	
	PageContextImpl pc=null;
	try {
		pc = createPageContext(factory,app,applicationName,cfid,ON_SESSION_END,true,-1);
		call(app,pc, ON_SESSION_END, new Object[]{pc.sessionScope(false),pc.applicationScope()},true);
	}
	finally {
		if(pc!=null){
			factory.releaseLuceePageContext(pc,true);
		}
	}
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:17,代碼來源:ModernAppListener.java

示例5: onError

import lucee.runtime.Component; //導入方法依賴的package包/類
@Override
public void onError(PageContext pc, PageException pe) {
	Component app =  apps.get(pc.getApplicationContext().getName());
	if(app!=null && app.containsKey(ON_ERROR) && !Abort.isSilentAbort(pe)) {
		try {
			String eventName="";
			if(pe instanceof ModernAppListenerException) eventName= ((ModernAppListenerException)pe).getEventName();
			if(eventName==null)eventName="";
			
			call(app,pc, ON_ERROR, new Object[]{pe.getCatchBlock(pc),eventName},true);
			return;
		}
		catch(PageException _pe) {
			pe=_pe;
		}
	}
	pc.handlePageException(pe);
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:19,代碼來源:ModernAppListener.java

示例6: setPropeties

import lucee.runtime.Component; //導入方法依賴的package包/類
public static void setPropeties(PageContext pc, Component c, Struct properties, boolean ignoreNotExisting) throws PageException { 
	if(properties==null) return;
	
	// argumentCollection
	if(properties.size()==1 && properties.containsKey(KeyConstants._argumentCollection) && !c.containsKey(KeyConstants._setArgumentCollection)) {
		properties=Caster.toStruct(properties.get(KeyConstants._argumentCollection));
	}
	
	Iterator<Entry<Key, Object>> it = properties.entryIterator();
	Entry<Key, Object> e;
	while(it.hasNext()){
		e = it.next();
		if(ignoreNotExisting) {
			try {
				c.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
			}
			catch(Throwable t) {ExceptionUtil.rethrowIfNecessary(t);}
		}
		else {
			c.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
		}
	}
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:24,代碼來源:EntityNew.java

示例7: call

import lucee.runtime.Component; //導入方法依賴的package包/類
public Object call(String cfcPath,String id,String functionName,Struct arguments, boolean cfcPeristent, Object defaultValue) throws PageException  {
	String requestURI=toRequestURI(cfcPath);
	
	PageContext oldPC = ThreadLocalPageContext.get();
	
	PageContextImpl pc=null;
	
	
	try {
		pc=createPageContext(requestURI,id,functionName,arguments,cfcPeristent,true);
		String ext = ResourceUtil.getExtension(cfcPath, null);
		ConfigWeb config=(ConfigWeb) ThreadLocalPageContext.getConfig();
		int dialect = ext==null?CFMLEngine.DIALECT_CFML: config.getFactory().toDialect(ext);
		//ThreadLocalPageContext.register(pc);
		Component cfc=getCFC(pc,requestURI);
		if(cfc.containsKey(functionName)){
			if(dialect==CFMLEngine.DIALECT_LUCEE)
				pc.execute(requestURI, true,false);
			else
				pc.executeCFML(requestURI, true,false);
			
			// Result
			return pc.variablesScope().get(AMF_FORWARD,null);
		}
	}
	finally{
		CFMLFactory f = config.getFactory();
		f.releaseLuceePageContext(pc,true);
		ThreadLocalPageContext.register(oldPC);
	}
	return defaultValue;
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:33,代碼來源:GatewayEngineImpl.java


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