本文整理汇总了Java中com.intellij.uiDesigner.compiler.Utils.validateJComponentClass方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.validateJComponentClass方法的具体用法?Java Utils.validateJComponentClass怎么用?Java Utils.validateJComponentClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.uiDesigner.compiler.Utils
的用法示例。
在下文中一共展示了Utils.validateJComponentClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createErrorComponent
import com.intellij.uiDesigner.compiler.Utils; //导入方法依赖的package包/类
private static RadErrorComponent createErrorComponent(final ModuleProvider module, final String id, final LwComponent lwComponent, final ClassLoader loader) {
final String componentClassName = lwComponent.getComponentClassName();
final String errorDescription = Utils.validateJComponentClass(loader, componentClassName, true);
return RadErrorComponent.create(
module,
id,
lwComponent.getComponentClassName(),
lwComponent.getErrorComponentProperties(),
errorDescription != null? errorDescription : UIDesignerBundle.message("error.cannot.load.class", componentClassName)
);
}
示例2: getLwProperties
import com.intellij.uiDesigner.compiler.Utils; //导入方法依赖的package包/类
public HashMap getLwProperties(final String className) {
if (myCache.containsKey(className)) {
return (HashMap)myCache.get(className);
}
if (Utils.validateJComponentClass(myLoader, className, false) != null) {
return null;
}
final Class aClass;
try {
aClass = Class.forName(className, false, myLoader);
}
catch (final ClassNotFoundException exc) {
throw new RuntimeException(exc.toString()); // should never happen
}
final BeanInfo beanInfo;
try {
beanInfo = Introspector.getBeanInfo(aClass);
}
catch (Throwable e) {
return null;
}
final HashMap result = new HashMap();
final PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
for (int i = 0; i < descriptors.length; i++) {
final PropertyDescriptor descriptor = descriptors[i];
final Method readMethod = descriptor.getReadMethod();
final Method writeMethod = descriptor.getWriteMethod();
final Class propertyType = descriptor.getPropertyType();
if (writeMethod == null || readMethod == null || propertyType == null) {
continue;
}
final String name = descriptor.getName();
final LwIntrospectedProperty property = propertyFromClass(propertyType, name);
if (property != null) {
property.setDeclaringClassName(descriptor.getReadMethod().getDeclaringClass().getName());
result.put(name, property);
}
}
myCache.put(className, result);
return result;
}