本文整理汇总了Java中com.google.gwt.core.ext.typeinfo.JType.isClass方法的典型用法代码示例。如果您正苦于以下问题:Java JType.isClass方法的具体用法?Java JType.isClass怎么用?Java JType.isClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.core.ext.typeinfo.JType
的用法示例。
在下文中一共展示了JType.isClass方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: filter
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
protected Set<JType> filter(final Set<JType> types, final Set<JClassType> uediInterfaces) {
final Set<JType> filteredTypes = new HashSet<JType>();
for (JType jType : types) {
jType = jType.getErasedType();
final JClassType classType = jType.isClass();
if (isAssignableFromAny(uediInterfaces, classType)) {
filteredTypes.add(classType);
}
}
return filteredTypes;
}
示例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: 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;
}
示例6: addMappers
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* Parse the configured serializer/deserializer configuration and put them into the corresponding map
*
* @param configuration configuration
* @param mapperType type of the mapper
* @param allSupportedSerializationClassBuilder builder aggregating all the types that have a serializer
* @param allSupportedDeserializationClassBuilder builder aggregating all the types that have a deserializer
*/
private void addMappers( final AbstractConfiguration configuration, final MapperType mapperType, Builder<JClassType>
allSupportedSerializationClassBuilder, Builder<JClassType> allSupportedDeserializationClassBuilder ) throws
UnableToCompleteException {
Map<Class, Class> configuredMapper = mapperType.getMapperTypeConfiguration( configuration );
for ( Entry<Class, Class> entry : configuredMapper.entrySet() ) {
JType mappedType = findType( entry.getKey() );
if ( null == mappedType ) {
continue;
}
JClassType mapperClassType = findClassType( entry.getValue() );
if ( null == mapperClassType ) {
continue;
}
if ( mapperType.isKey() ) {
MapperInstance keyMapperInstance = getKeyInstance( mappedType, mapperClassType, mapperType.isSerializer() );
if ( mapperType.isSerializer() ) {
keySerializers.put( mappedType.getQualifiedSourceName(), keyMapperInstance );
} else {
keyDeserializers.put( mappedType.getQualifiedSourceName(), keyMapperInstance );
}
} else {
MapperInstance mapperInstance = getInstance( mappedType, mapperClassType, mapperType.isSerializer() );
if ( null != mapperInstance ) {
if ( mapperType.isSerializer() ) {
serializers.put( mappedType.getQualifiedSourceName(), mapperInstance );
if ( null != mappedType.isClass() ) {
allSupportedSerializationClassBuilder.add( mappedType.isClass() );
}
} else {
deserializers.put( mappedType.getQualifiedSourceName(), mapperInstance );
if ( null != mappedType.isClass() ) {
allSupportedDeserializationClassBuilder.add( mappedType.isClass() );
}
}
}
}
}
}
示例7: isObject
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* <p>isObject</p>
*
* @param type the type to test
* @return true if the type is {@link Object}, false otherwise
*/
public static boolean isObject( JType type ) {
return null != type.isClass() && Object.class.getName().equals( type.getQualifiedSourceName() );
}
示例8: isKeySerializer
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* <p>isKeySerializer</p>
*
* @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object.
* @return a boolean.
*/
public boolean isKeySerializer( JType type ) {
return null != type.isClass() && type.isClass().isAssignableTo( keySerializerType );
}
示例9: isKeyDeserializer
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* <p>isKeyDeserializer</p>
*
* @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object.
* @return a boolean.
*/
public boolean isKeyDeserializer( JType type ) {
return null != type.isClass() && type.isClass().isAssignableTo( keyDeserializerType );
}
示例10: isJsonSerializer
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* <p>isJsonSerializer</p>
*
* @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object.
* @return a boolean.
*/
public boolean isJsonSerializer( JType type ) {
return null != type.isClass() && type.isClass().isAssignableTo( jsonSerializerType );
}
示例11: isJsonDeserializer
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* <p>isJsonDeserializer</p>
*
* @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object.
* @return a boolean.
*/
public boolean isJsonDeserializer( JType type ) {
return null != type.isClass() && type.isClass().isAssignableTo( jsonDeserializerType );
}
示例12: isJavaScriptObject
import com.google.gwt.core.ext.typeinfo.JType; //导入方法依赖的package包/类
/**
* <p>isJavaScriptObject</p>
*
* @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object.
* @return a boolean.
*/
public boolean isJavaScriptObject( JType type ) {
return null != type.isClass() && type.isClass().isAssignableTo( jsoType );
}