All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zkoss.zk.scripting.bsh.NSWrap Maven / Gradle / Ivy

There is a newer version: 10.0.0-jakarta
Show newest version
/* NSWrap.java

	Purpose:
		
	Description:
		
	History:
		Fri Dec  2 11:58:52 TST 2011, Created by tomyeh

Copyright (C) 2011 Potix Corporation. All Rights Reserved.

*/
package org.zkoss.zk.scripting.bsh;

import bsh.NameSpace;

import org.zkoss.zk.ui.ext.Scope;

/** Non-serializable Namespace wrapper.
 * Used to prevent to serialize NameSpace directly.
 * 
 * @author tomyeh
 */
/*package*/ class NSWrap {
	protected NameSpace _bshns;

	/*package*/ static NSWrap getInstance(NameSpace ns) {
		if (ns instanceof BSHInterpreter.NS)
			return new NSWrapSR(ns);
		return new NSWrap(ns);
	}

	protected NSWrap(NameSpace ns) {
		_bshns = ns;
	}

	public NSWrap() {
	}

	/** Returns the associated NameSpace. */
	public NameSpace unwrap(Scope ns) {
		return _bshns;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy