本文整理匯總了Java中lucee.runtime.Component.MODIFIER_ABSTRACT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Component.MODIFIER_ABSTRACT屬性的具體用法?Java Component.MODIFIER_ABSTRACT怎麽用?Java Component.MODIFIER_ABSTRACT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類lucee.runtime.Component
的用法示例。
在下文中一共展示了Component.MODIFIER_ABSTRACT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initComponent
private static ComponentImpl initComponent(PageContext pc,CIPage page,String callPath,boolean isRealPath,final boolean isExtendedComponent, boolean executeConstr) throws PageException {
// is not a component, then it has to be a interface
if(!(page instanceof ComponentPageImpl))
throw new ApplicationException("you cannot instantiate the interface ["+
page.getPageSource().getDisplayPath()+"] as a component ("+page.getClass().getName()+""+(page instanceof InterfacePageImpl)+")");
ComponentPageImpl cp = (ComponentPageImpl)page;
ComponentImpl c = cp.newInstance(pc,callPath,isRealPath, isExtendedComponent,executeConstr);
// abstract/final check
if(!isExtendedComponent) {
if(c.getModifier()==Component.MODIFIER_ABSTRACT)
throw new ApplicationException("you cannot instantiate an abstract component ["+page.getPageSource().getDisplayPath()+"], this component can only be extended by other components");
}
else if(c.getModifier()==Component.MODIFIER_FINAL)
throw new ApplicationException("you cannot extend a final component ["+page.getPageSource().getDisplayPath()+"]");
c.setInitalized(true);
return c;
}
示例2: add
public void add(Collection.Key key, UDF udf) throws ApplicationException {
if(Component.MODIFIER_ABSTRACT==udf.getModifier())
absUDFs.put(key, udf);
if(Component.MODIFIER_FINAL==udf.getModifier()) {
if(finUDFs.containsKey(key)) {
UDF existing = finUDFs.get(key);
throw new ApplicationException("the function ["+key+"] from component ["+
udf.getSource()+
"] tries to override a final method with the same name from component ["+
existing.getSource()+"]");
}
finUDFs.put(key, udf);
}
}
示例3: toModifier
public static int toModifier(String str, int emptyValue, int defaultValue) {
if(StringUtil.isEmpty(str,true)) return emptyValue;
str=str.trim();
if("abstract".equalsIgnoreCase(str)) return Component.MODIFIER_ABSTRACT;
if("final".equalsIgnoreCase(str)) return Component.MODIFIER_FINAL;
if("none".equalsIgnoreCase(str)) return Component.MODIFIER_NONE;
return defaultValue;
}