当前位置: 首页>>代码示例>>Java>>正文


Java Struct.entryIterator方法代码示例

本文整理汇总了Java中lucee.runtime.type.Struct.entryIterator方法的典型用法代码示例。如果您正苦于以下问题:Java Struct.entryIterator方法的具体用法?Java Struct.entryIterator怎么用?Java Struct.entryIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lucee.runtime.type.Struct的用法示例。


在下文中一共展示了Struct.entryIterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCustomType

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
@Override
public CustomType getCustomType(String strType) {
	if(!initCustomTypes) {
		if(customTypes==null)
			customTypes=new HashMap<String, CustomType>();
		
		// this.type.susi=function(any value){};
		Struct sct = Caster.toStruct(get(component,KeyConstants._type,null),null);
		if(sct!=null) {
			Iterator<Entry<Key, Object>> it = sct.entryIterator();
			Entry<Key, Object> e;
			UDF udf;
			while(it.hasNext()){
				e = it.next();
				udf=Caster.toFunction(e.getValue(), null);
				if(udf!=null) customTypes.put(e.getKey().getLowerString(), new UDFCustomType(udf));
			}
		}
	}
	return customTypes.get(strType.trim().toLowerCase());
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:22,代码来源:ModernApplicationContext.java

示例2: getCustomType

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
@Override
public CustomType getCustomType(String strType) {
	if(!initCustomTypes) {
		if(customTypes==null)
			customTypes=new HashMap<String, CustomType>();
		
		// this.type.susi=function(any value){};
		Struct sct = Caster.toStruct(get(component,KeyConstants._type,null),null);
		if(sct!=null) {
			Iterator<Entry<Key, Object>> it = sct.entryIterator();
			Entry<Key, Object> e;
			UDF udf;
			while(it.hasNext()){
				e = it.next();
				udf=Caster.toFunction(e.getValue(), null);
				if(udf!=null) customTypes.put(e.getKey().getLowerString(), new UDFCustomType(udf));
			}
		}
		initCustomTypes=true;
	}
	return customTypes.get(strType.trim().toLowerCase());
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:23,代码来源:ModernApplicationContext.java

示例3: invoke

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
private static Object invoke(PageContext pc, Struct sct, UDF udf, Object initalValue) throws PageException {
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	while(it.hasNext()){
		e = it.next();
		initalValue=udf.call(pc, new Object[]{initalValue,e.getKey().getString(),e.getValue(),sct}, true);
	}
	return initalValue;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:10,代码来源:Reduce.java

示例4: toCookies

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
public static Cookie[] toCookies(Struct sct) throws PageException {
	if(sct==null) return new Cookie[0];
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	List<Cookie> cookies=new ArrayList<Cookie>();
	Cookie c;
	while(it.hasNext()){
		e = it.next();
		c=ReqRspUtil.toCookie(e.getKey().getString(), Caster.toString(e.getValue()),null);
		if(c!=null)cookies.add(c);
		else throw new ApplicationException("Cookie name ["+e.getKey().getString()+"] is invalid");
		
	}
	return cookies.toArray(new Cookie[cookies.size()]);
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:16,代码来源:CreatePageContext.java

示例5: _initTagDefaultAttributeValues

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
private static void _initTagDefaultAttributeValues(Config config,TagLib lib,
		Map<Collection.Key, Map<Collection.Key, Object>> tagDefaultAttributeValues, Struct sct, boolean checkNameSpace) {
	if(sct==null) return;
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	// loop tags
	Struct attrs;
	TagLibTag tag;
	Iterator<Entry<Key, Object>> iit;
	Entry<Key, Object> e;
	Map<Collection.Key,Object> map;
	TagLibTagAttr attr;
	String name;
	while(it.hasNext()){
		e = it.next();
		attrs=Caster.toStruct(e.getValue(),null);
		if(attrs!=null){
			tag=null;
			if(checkNameSpace) {
				name=e.getKey().getLowerString();
				if(StringUtil.startsWithIgnoreCase(name, lib.getNameSpaceAndSeparator())) {
					name=name.substring(lib.getNameSpaceAndSeparator().length());
					tag = lib.getTag(name);
				}
			}
			else
				tag = lib.getTag(e.getKey().getLowerString());
			
			if(tag!=null) {
				sct.removeEL(e.getKey());
				map=new HashMap<Collection.Key, Object>();
				iit = attrs.entryIterator();
				while(iit.hasNext()){
					e = iit.next();
					map.put(KeyImpl.init(e.getKey().getLowerString()),e.getValue());
				}
				tagDefaultAttributeValues.put(KeyImpl.init(tag.getFullName()), map);
			}
		}	
	}
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:41,代码来源:ApplicationContextSupport.java

示例6: convert

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
public static SQL convert(String sql, Struct params) throws PageException{
	Iterator<Entry<Key, Object>> it = params.entryIterator();
	List<SQLItems<NamedSQLItem>> namedItems=new ArrayList<SQLItems<NamedSQLItem>>();
	Entry<Key, Object> e;
	while(it.hasNext()){
		e = it.next();
		namedItems.add(toNamedSQLItem(e.getKey().getString(),e.getValue()));
	}
	return convert(sql, new ArrayList<SQLItems<SQLItem>>(), namedItems);
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:11,代码来源:QueryParamConverter.java

示例7: toDataSources

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
public static DataSource[] toDataSources(Object o) throws PageException, ClassException {
	Struct sct = Caster.toStruct(o);
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	java.util.List<DataSource> dataSources=new ArrayList<DataSource>();
	while(it.hasNext()) {
		e = it.next();
		dataSources.add(toDataSource(e.getKey().getString().trim(), Caster.toStruct(e.getValue())));
	}
	return dataSources.toArray(new DataSource[dataSources.size()]);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:12,代码来源:AppListenerUtil.java

示例8: toPair

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
private static Pair<String,Object>[] toPair(Struct sct, boolean doStringCast) throws PageException {
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	Object value;
	List<Pair<String,Object>> pairs=new ArrayList<Pair<String,Object>>();
	while(it.hasNext()){
		e = it.next();
		value= e.getValue();
		if(doStringCast)value=Caster.toString(value);
		pairs.add(new Pair<String,Object>(e.getKey().getString(),value));
	}
	return pairs.toArray(new Pair[pairs.size()]);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:14,代码来源:CreatePageContext.java

示例9: fillForm

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
private static void fillForm(PageContextImpl _pc, Struct src) throws PageException {
	if(src==null) return;
	Iterator<Entry<Key, Object>> it = src.entryIterator();
	Form trg = _pc.formScope();
	Entry<Key, Object> e;
	while(it.hasNext()) {
		e = it.next();
		trg.set(e.getKey(), e.getValue());
	}
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:11,代码来源:InternalRequest.java

示例10: toMappings

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
public static Mapping[] toMappings(ConfigWeb cw,Object o, Resource source) throws PageException {
	Struct sct = Caster.toStruct(o);
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	java.util.List<Mapping> mappings=new ArrayList<Mapping>();
	ConfigWebImpl config=(ConfigWebImpl) cw;
	String virtual;
	while(it.hasNext()) {
		e = it.next();
		virtual=translateMappingVirtual(e.getKey().getString());
		MappingData md=toMappingData(e.getValue(),source);
		mappings.add(config.getApplicationMapping("application",virtual,md.physical,md.archive,md.physicalFirst,false));
	}
	return mappings.toArray(new Mapping[mappings.size()]);
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:16,代码来源:AppListenerUtil.java

示例11: setPassthrough

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
/**
 * @param passthrough The passThrough to set.
 * @throws PageException
 */
public void setPassthrough(Object passthrough) throws PageException {
    if(passthrough instanceof Struct) {
        Struct sct = (Struct) passthrough;
        Iterator<Entry<Key, Object>> it = sct.entryIterator();
        Entry<Key, Object> e;
        while(it.hasNext()) {
        	e=it.next();
            attributes.setEL(e.getKey(),e.getValue());
        }
    }
    else this.passthrough = Caster.toString(passthrough);
    
    //input.setPassThrough(passThrough);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:19,代码来源:Input.java

示例12: sizeOf

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
/**
 * return the size of given struct, size of values + keys
 * @param sct
 * @return
 */
public static long sizeOf(Struct sct) {
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	long size = 0;
	while(it.hasNext()) {
		e = it.next();
		size+=SizeOf.size(e.getKey());
		size+=SizeOf.size(e.getValue());
	}
	return size;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:17,代码来源:StructUtil.java

示例13: createPageContext

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
private static PageContextImpl createPageContext(PageContext pc, String template, Struct urls, Struct cookies, Struct headers, byte[] body, Charset charset, OutputStream os) throws PageException {
	
	// query string | URL
			Entry<Key, Object> e;
			StringBuilder sbQS=new StringBuilder();
			if(urls!=null) {
				Iterator<Entry<Key, Object>> it = urls.entryIterator();
				while(it.hasNext()) {
					e = it.next();
					if(sbQS.length()>0) sbQS.append('&');
					sbQS.append(urlenc(e.getKey().getString(),charset));
					sbQS.append('=');
					sbQS.append(urlenc(Caster.toString(e.getValue()), charset));
				}
			}
	
	return ThreadUtil.createPageContext(
			pc.getConfig(), 
			os, 
			pc.getHttpServletRequest().getServerName(), 
			 template, 
			sbQS.toString(), 
			CreatePageContext.toCookies(cookies), 
			CreatePageContext.toPair(headers,true),
			body,
			CreatePageContext.toPair(new StructImpl(),true), 
			CreatePageContext.castValuesToString(new StructImpl()),true,-1);
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:29,代码来源:InternalRequest.java

示例14: onMissingMethod

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
public Object onMissingMethod(PageContext pc, int access,Member member,String name,Object _args[],Struct _namedArgs, boolean superAccess) throws PageException {
	Member ommm = access==-1?
			getMember(pc,KeyConstants._onmissingmethod,false, superAccess):
			getMember(access,KeyConstants._onmissingmethod,false, superAccess);
    if(ommm instanceof UDF) {
    	Argument args=new ArgumentImpl();
    	if(_args!=null) {
    		for(int i=0;i<_args.length;i++) {
    			args.setEL(ArgumentIntKey.init(i+1), _args[i]);
    		}
    	}
    	else if(_namedArgs!=null) {
    		UDFUtil.argumentCollection(_namedArgs, new FunctionArgument[]{});
    		
    		Iterator<Entry<Key, Object>> it = _namedArgs.entryIterator();
    		Entry<Key, Object> e;
    		while(it.hasNext()){
    			e = it.next();
    			args.setEL(e.getKey(),e.getValue());
    		}
    		
    	}
    	
    	//Struct newArgs=new StructImpl(StructImpl.TYPE_SYNC);
    	//newArgs.setEL(MISSING_METHOD_NAME, name);
    	//newArgs.setEL(MISSING_METHOD_ARGS, args); 
    	Object[] newArgs=new Object[]{name,args};
    	
    	return _call(pc,KeyConstants._onmissingmethod,(UDFPlus)ommm,null,newArgs);
    }
    if(member==null)throw ComponentUtil.notFunction(this, KeyImpl.init(name), null,access);
    throw ComponentUtil.notFunction(this, KeyImpl.init(name), member.getValue(),access);
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:34,代码来源:ComponentImpl.java

示例15: translate

import lucee.runtime.type.Struct; //导入方法依赖的package包/类
/**
 * translate all strig values of the struct i script-protected form
 * @param sct Struct to translate its values
 */
public static void translate(Struct sct) {
	Iterator<Entry<Key, Object>> it = sct.entryIterator();
	Entry<Key, Object> e;
	Object value;
	while(it.hasNext()) {
		e = it.next();
		value=e.getValue(); 
		if(value instanceof String) {
			sct.setEL(e.getKey(),translate((String)value));
		}
	}
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:17,代码来源:ScriptProtect.java


注:本文中的lucee.runtime.type.Struct.entryIterator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。