本文整理汇总了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;
}