本文整理汇总了Java中com.google.gwt.core.ext.typeinfo.JType.isInterface方法的典型用法代码示例。如果您正苦于以下问题:Java JType.isInterface方法的具体用法?Java JType.isInterface怎么用?Java JType.isInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.core.ext.typeinfo.JType
的用法示例。
在下文中一共展示了JType.isInterface方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isJsType
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
boolean isJsType( JType type )
{
JClassType cType = type.isClass();
if( cType == null )
cType = type.isInterface();
if( cType == null )
return false;
Annotation[] annotations = cType.getDeclaredAnnotations();
for( Annotation annotation : annotations )
{
if( "jsinterop.annotations.JsType".equals( annotation.annotationType().getName() ) )
return true;
}
return false;
}
示例2: isValideType
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
private boolean isValideType(JType type){
if(type == null)
return false;
if(type.isInterface() != null)
return false;
if(type.isPrimitive() != null)
return true;
JClassType aClass = type.isClass();
if(aClass != null && (aClass.isAssignableTo(serializableIntf) || aClass.isAssignableTo(isSerializableIntf))){
return true;
}
JArrayType array = type.isArray();
if(array == null) return false;
return isValideType(array.getComponentType());
}
示例3: isJSOType
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
boolean isJSOType( JType type )
{
JClassType cType = type.isClass();
if( cType == null )
cType = type.isInterface();
if( cType == null )
return false;
for( JClassType t = cType; t != null; t = t.getSuperclass() )
{
sw.println( "// supertype : " + t.getSimpleSourceName() );
JTypeParameter typeParam = t.isTypeParameter();
if( typeParam != null )
{
sw.println( "// which is a type parameter" );
JClassType[] bounds = typeParam.getBounds();
for( int b = 0; b < bounds.length; b++ )
{
sw.println( "// which is bound to : " + bounds[b].getSimpleSourceName() );
if( bounds[b].getSimpleSourceName().compareTo( "JavaScriptObject" ) == 0 )
return true;
}
}
if( t.getSimpleSourceName().compareTo( "JavaScriptObject" ) == 0 )
return true;
}
return false;
}
示例4: isJSOType
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
boolean isJSOType( JType type )
{
JClassType cType = type.isClass();
if( cType == null )
cType = type.isInterface();
if( cType == null )
return false;
for( JClassType t = cType; t != null; t = t.getSuperclass() )
{
// sw.println( "// supertype : " + t.getSimpleSourceName() );
JTypeParameter typeParam = t.isTypeParameter();
if( typeParam != null )
{
// sw.println( "// which is a type parameter" );
JClassType[] bounds = typeParam.getBounds();
for( int b = 0; b < bounds.length; b++ )
{
// sw.println( "// which is bound to : " +
// bounds[b].getSimpleSourceName() );
if( bounds[b].getSimpleSourceName().compareTo( "JavaScriptObject" ) == 0 )
return true;
}
}
if( t.getSimpleSourceName().compareTo( "JavaScriptObject" ) == 0 )
return true;
}
return false;
}
示例5: isSerializable
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* <p>isSerializable</p>
*
* @param type the type to test
* @return true if the type is {@link Serializable}, false otherwise
*/
public static boolean isSerializable( JType type ) {
return null != type.isInterface() && Serializable.class.getName().equals( type.getQualifiedSourceName() );
}