本文整理了Java中org.eclipse.persistence.internal.helper.Helper.getInstanceFromClass()
方法的一些代码示例,展示了Helper.getInstanceFromClass()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.getInstanceFromClass()
方法的具体详情如下:
包路径:org.eclipse.persistence.internal.helper.Helper
类名称:Helper
方法名:getInstanceFromClass
[英]Return the class instance from the class
[中]从类返回类实例
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* Sets a comparator class for this policy to use when instantiating
* a new SortedSet object.
*/
public void setComparatorClass(Class comparatorClass) {
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
}
this.comparatorClass=comparatorClass;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* Sets a comparator class for this policy to use when instantiating
* a new SortedSet object.
*/
public void setComparatorClass(Class comparatorClass) {
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
}
this.comparatorClass=comparatorClass;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* Sets a comparator class for this policy to use when instantiating
* a new SortedSet object.
*/
public void setComparatorClass(Class comparatorClass) {
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
}
this.comparatorClass=comparatorClass;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* Convert all the class-name-based settings in this SortedCollectionContainerPolicy to actual class-based
* settings. This method is used when converting a project that has been built
* with class names to a project with classes.
* @param classLoader
*/
public void convertClassNamesToClasses(ClassLoader classLoader){
super.convertClassNamesToClasses(classLoader);
if(m_comparator==null){
if(comparatorClass==null){
if(comparatorClassName!=null){
Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader);
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClassName);
}
}
}else{
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
}
}
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* Convert all the class-name-based settings in this SortedCollectionContainerPolicy to actual class-based
* settings. This method is used when converting a project that has been built
* with class names to a project with classes.
* @param classLoader
*/
public void convertClassNamesToClasses(ClassLoader classLoader){
super.convertClassNamesToClasses(classLoader);
if(m_comparator==null){
if(comparatorClass==null){
if(comparatorClassName!=null){
Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader);
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClassName);
}
}
}else{
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
}
}
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* Convert all the class-name-based settings in this SortedCollectionContainerPolicy to actual class-based
* settings. This method is used when converting a project that has been built
* with class names to a project with classes.
* @param classLoader
*/
public void convertClassNamesToClasses(ClassLoader classLoader){
super.convertClassNamesToClasses(classLoader);
if(m_comparator==null){
if(comparatorClass==null){
if(comparatorClassName!=null){
Class comparatorClass = Helper.getClassFromClasseName(comparatorClassName, classLoader);
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClassName);
}
}
}else{
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
}
}
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
if(m_comparator==null && comparatorClass!=null){
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
if(m_comparator==null && comparatorClass!=null){
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
if(m_comparator==null && comparatorClass!=null){
if(Helper.classImplementsInterface(comparatorClass, java.util.Comparator.class)){
m_comparator=(Comparator)Helper.getInstanceFromClass(comparatorClass);
}else{
throw ValidationException.invalidComparatorClass(comparatorClass.getName());
内容来源于网络,如有侵权,请联系作者删除!