本文整理汇总了Java中com.allaire.cfx.CustomTag类的典型用法代码示例。如果您正苦于以下问题:Java CustomTag类的具体用法?Java CustomTag怎么用?Java CustomTag使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CustomTag类属于com.allaire.cfx包,在下文中一共展示了CustomTag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCustomTag
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public synchronized CustomTag getCustomTag(String name) throws CFXTagException {
name=name.toLowerCase();
Object o=classes.get(name);
if(o==null) {
Set<String> set = classes.keySet();
String names = ListUtil.arrayToList(set.toArray(new String[set.size()]),",");
throw new CFXTagException("there is no Custom Tag (CFX) with name ["+name+"], available Custom Tags are ["+names+"]");
}
CFXTagClass ctc=(CFXTagClass) o;
CustomTag ct = ctc.newInstance();
//if(!(o instanceof CustomTag))throw new CFXTagException("["+name+"] is not of type ["+CustomTag.class.getName()+"]");
return ct;
}
示例2: verifyCFX
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
public void verifyCFX(String name) throws PageException {
CFXTagPool pool=config.getCFXTagPool();
CustomTag ct=null;
try {
ct = pool.getCustomTag(name);
}
catch (CFXTagException e) {
throw Caster.toPageException(e);
}
finally {
if(ct!=null)pool.releaseCustomTag(ct);
}
}
示例3: verifyJavaCFX
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
public void verifyJavaCFX(String name,String strClass) throws PageException {
try {
Class clazz = ClassUtil.loadClass(config.getClassLoader(),strClass);
if(!Reflector.isInstaneOf(clazz, CustomTag.class))
throw new ExpressionException("class ["+strClass+"] must implement interface ["+CustomTag.class.getName()+"]");
}
catch (ClassException e) {
throw Caster.toPageException(e);
}
if(StringUtil.startsWithIgnoreCase(name,"cfx_"))name=name.substring(4);
if(StringUtil.isEmpty(name))
throw new ExpressionException("class name can't be a empty value");
}
示例4: newInstance
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public CustomTag newInstance() throws CFXTagException {
try {
return _newInstance();
} catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
throw new CFXTagException(e);
}
}
示例5: getClazz
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
/**
* @return Returns the clazz.
* @throws ClassNotFoundException
*/
public Class<CustomTag> getClazz() throws ClassNotFoundException {
if(clazz==null) {
clazz=this.getClass().getClassLoader().loadClass(strClass);
}
return clazz;
}
示例6: isValid
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public boolean isValid() {
try {
return Reflector.isInstaneOf(getClazz(),CustomTag.class);
}
catch (ClassNotFoundException e) {
return false;
}
}
示例7: newInstance
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public CustomTag newInstance() throws CFXTagException {
try {
return _newInstance();
} catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
throw new CFXTagException(e);
}
}
示例8: isValid
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public boolean isValid() {
try {
return Reflector.isInstaneOf(getClazz(),CustomTag.class);
}
catch (Exception e) {
return false;
}
}
示例9: runJavaCFX
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
private void runJavaCFX( cfSession _Session, boolean debugOn, String className, int reloadType )
throws cfmRunTimeException
{
try
{
CustomTag customJavaClass = getCustomTag( className, reloadType );
//--[ Create the necessary parameters
sessionRequest sRequest = new sessionRequest( _Session, evaluateAttributes( _Session ), debugOn );
sessionResponse sResponse = new sessionResponse( _Session, debugOn );
long startTime = System.currentTimeMillis(); // for debug timings
customJavaClass.processRequest( sRequest, sResponse );
long processingTime = System.currentTimeMillis() - startTime;
if ( debugOn )
{
_Session.write( "<hr><b>" + className + "</b> Execution Time = " + processingTime + " ms <br><hr>" );
}
}
catch( java.lang.Exception E )
{
cfCatchData catchData = new cfCatchData( _Session );
catchData.setType( "Application" );
catchData.setMessage( "CFCFX: " + tagName );
catchData.setDetail( E.toString() );
throw newRunTimeException( catchData );
}
}
示例10: getCustomTag
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
private CustomTag getCustomTag( String className, int reloadType ) throws Exception
{
//--[ Try to find the class
getJavaCFXClass( className, reloadType );
//--[ return an instance of the class
return (CustomTag)cfxClass.newInstance();
}
示例11: _newInstance
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
public CustomTag _newInstance() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
Object o=getClazz().newInstance();
return (CustomTag)o;
}
示例12: releaseCustomTag
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public synchronized void releaseCustomTag(CustomTag ct) {
//table.put(ct.getClass().toString(),ct);
}
示例13: newInstance
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public CustomTag newInstance() throws CFXTagException {
return new CPPCustomTag(serverLibrary,procedure,keepAlive);
}
示例14: _newInstance
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
public CustomTag _newInstance() throws InstantiationException, IllegalAccessException, ClassException, BundleException {
Object o=getClazz().newInstance();
return (CustomTag)o;
}
示例15: releaseCustomTag
import com.allaire.cfx.CustomTag; //导入依赖的package包/类
@Override
public void releaseCustomTag(CustomTag ct) {
//table.put(ct.getClass().toString(),ct);
}