本文整理汇总了Java中org.javarosa.core.util.externalizable.CannotCreateObjectException类的典型用法代码示例。如果您正苦于以下问题:Java CannotCreateObjectException类的具体用法?Java CannotCreateObjectException怎么用?Java CannotCreateObjectException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CannotCreateObjectException类属于org.javarosa.core.util.externalizable包,在下文中一共展示了CannotCreateObjectException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerPrototype
import org.javarosa.core.util.externalizable.CannotCreateObjectException; //导入依赖的package包/类
public static void registerPrototype (String className) {
getPrototypes().addString(className);
try {
PrototypeFactory.getInstance(Class.forName(className));
} catch (ClassNotFoundException e) {
throw new CannotCreateObjectException(className + ": not found");
}
rebuild();
}
示例2: validateDataType
import org.javarosa.core.util.externalizable.CannotCreateObjectException; //导入依赖的package包/类
/**
* Validate that the record type for this StorageUtility meets all requirements
*
* @param type Class object for the type of object this StorageUtility will handle
*/
private void validateDataType (Class type) {
if (Externalizable.class.isAssignableFrom(type)) {
try {
PrototypeFactory.getInstance(type);
} catch (CannotCreateObjectException ccoe) {
throw new IllegalArgumentException("Cannot create storage utility. Type [" + type.getName() + "] cannot be used. (" + ccoe.getMessage() + ")");
}
} else {
throw new IllegalArgumentException("Cannot create storage utility. Type [" + type.getName() + "] is not externalizable.");
}
}
示例3: registerPrototype
import org.javarosa.core.util.externalizable.CannotCreateObjectException; //导入依赖的package包/类
public static void registerPrototype(String className) {
getPrototypes().addString(className);
try {
PrototypeFactory.getInstance(Class.forName(className));
} catch (ClassNotFoundException e) {
throw new CannotCreateObjectException(className + ": not found");
}
rebuild();
}
示例4: registerPrototype
import org.javarosa.core.util.externalizable.CannotCreateObjectException; //导入依赖的package包/类
public static void registerPrototype(String className) {
prototypes.add(className);
try {
PrototypeFactory.getInstance(Class.forName(className));
} catch (ClassNotFoundException e) {
throw new CannotCreateObjectException(className + ": not found");
}
rebuild();
}