JClassType[] interfaces = c.getImplementedInterfaces(); if (interfaces != null) { for (JClassType i : interfaces) {
JClassType[] interfaces = c.getImplementedInterfaces(); if (interfaces != null) { for (JClassType i : interfaces) {
if (c != null && c.getImplementedInterfaces() != null) { interfaces = "new HashSet<Class>(Arrays.asList("; boolean used = false; for (JType i : c.getImplementedInterfaces()) { if (!isVisible(i) || i.equals(t)) continue; if (used) interfaces += ", ";
if (c != null && c.getImplementedInterfaces() != null) { interfaces = "new HashSet<Class>(Arrays.asList("; boolean used = false; for (JType i : c.getImplementedInterfaces()) { if (!isVisible(i) || i.equals(t)) continue; if (used) interfaces += ", ";
/** * Determine if a type is derived from CssResource. */ private boolean derivedFromCssResource(JClassType type, JClassType cssResourceType) { List<JClassType> superInterfaces = Arrays.asList(type.getImplementedInterfaces()); if (superInterfaces.contains(cssResourceType)) { return true; } JClassType superClass = type.getSuperclass(); if (superClass != null) { if (derivedFromCssResource(superClass, cssResourceType)) { return true; } } for (JClassType superInterface : superInterfaces) { if (derivedFromCssResource(superInterface, cssResourceType)) { return true; } } return false; }
public static <T> boolean isInstanceOf(JClassType classType, Class<T> interfaceType) { for(JClassType type : classType.getImplementedInterfaces()) { if(type.getQualifiedSourceName().equals(interfaceType.getName())) { return true; } } return false; } }
public boolean implementsInterface(Class<?> interf8ce){ for(JClassType i : this.type.getImplementedInterfaces()){ if (i.getQualifiedSourceName().equals(interf8ce.getCanonicalName())){ return true; } } return false; }
public static <T> boolean isInstanceOf(JClassType classType, Class<T> interfaceType) { for(JClassType type : classType.getImplementedInterfaces()) { if(type.getQualifiedSourceName().equals(interfaceType.getName())) { return true; } } return false; } }
@Override public MetaClass[] getInterfaces() { if (_intefacesCache != null) { return _intefacesCache; } final JClassType jClassType = getEnclosedMetaObject().isClassOrInterface(); if (jClassType == null) return new MetaClass[0]; return _intefacesCache = Arrays.stream(jClassType.getImplementedInterfaces()) .map(i -> new GWTClass(oracle, i, false)).toArray(s -> new MetaClass[s]); }
@Override public MetaClass[] getInterfaces() { if (_intefacesCache != null) { return _intefacesCache; } final JClassType jClassType = getEnclosedMetaObject().isClassOrInterface(); if (jClassType == null) return new MetaClass[0]; return _intefacesCache = Arrays.stream(jClassType.getImplementedInterfaces()) .map(i -> new GWTClass(oracle, i, false)).toArray(s -> new MetaClass[s]); }
private JClassType getTargetType(JClassType interfaceType, TypeOracle typeOracle) { JClassType[] superTypes = interfaceType.getImplementedInterfaces(); return superTypes[0].isParameterized().getTypeArgs()[0]; }
private JClassType getGwtSpecificValidator(final TreeLogger logger, final JClassType validator) throws UnableToCompleteException { for (final JClassType interfaceType : validator.getImplementedInterfaces()) { if (interfaceType.getQualifiedSourceName() .endsWith(GwtSpecificValidator.class.getCanonicalName())) { return interfaceType; } } logger.log(TreeLogger.ERROR, validator.getQualifiedSourceName() + " must implement " + GwtSpecificValidator.class.getCanonicalName(), null); throw new UnableToCompleteException(); } }
private JClassType getGwtSpecificValidator(TreeLogger logger, JClassType validator) throws UnableToCompleteException { for (JClassType interfaceType : validator.getImplementedInterfaces()) { if (interfaceType.getQualifiedSourceName().endsWith( GwtSpecificValidator.class.getCanonicalName())) { return interfaceType; } } logger.log(TreeLogger.ERROR, validator.getQualifiedSourceName() + " must implement " + GwtSpecificValidator.class.getCanonicalName(), null); throw new UnableToCompleteException(); } }
private static JClassType findFactoryType( JClassType placeHistoryMapperWithFactoryType, JClassType interfaceType) { JClassType superInterfaces[] = interfaceType.getImplementedInterfaces(); for (JClassType superInterface : superInterfaces) { JParameterizedType parameterizedType = superInterface.isParameterized(); if (parameterizedType != null && parameterizedType.getBaseType().equals( placeHistoryMapperWithFactoryType)) { return parameterizedType.getTypeArgs()[0]; } } return null; }
private static JClassType findFactoryType( JClassType placeHistoryMapperWithFactoryType, JClassType interfaceType) { JClassType superInterfaces[] = interfaceType.getImplementedInterfaces(); for (JClassType superInterface : superInterfaces) { JParameterizedType parameterizedType = superInterface.isParameterized(); if (parameterizedType != null && parameterizedType.getBaseType().equals( placeHistoryMapperWithFactoryType)) { return parameterizedType.getTypeArgs()[0]; } } return null; }
private JClassType getTargetType(JClassType interfaceType, TypeOracle typeOracle) { JClassType[] superTypes = interfaceType.getImplementedInterfaces(); JClassType eventBinderType = typeOracle.findType(EventBinder.class.getCanonicalName()); if (superTypes.length != 1 || !superTypes[0].isAssignableFrom(eventBinderType) || superTypes[0].isParameterized() == null) { throw new IllegalArgumentException( interfaceType + " must extend EventBinder with a type parameter"); } return superTypes[0].isParameterized().getTypeArgs()[0]; }
private void tryGenerateDelegate() throws NotFoundException, UnableToCompleteException { JClassType resourceDelegateType = typeOracle.getType(ResourceDelegate.class.getName()); JClassType type = typeOracle.getType(typeName); JClassType[] implementedInterfaces = type.getImplementedInterfaces(); for (JClassType implementedInterface : implementedInterfaces) { if (implementedInterface.isAssignableTo(resourceDelegateType)) { doGenerate(type, implementedInterface); return; } } throw new UnableToCompleteException(); }
private String generateStaticInstance(TypeOracle oracle, TreeLogger logger, GeneratorContext context, JClassType classtype) throws UnableToCompleteException { if(checkImplementedInterface(oracle, classtype.getImplementedInterfaces())) { String fullName = classtype.getQualifiedSourceName(); InlineClientBundleGenerator gen = new InlineClientBundleGenerator(); return gen.generate(logger, context, fullName); } return null; }
private String generateStaticInstance(TypeOracle oracle, TreeLogger logger, GeneratorContext context, JClassType classtype) throws UnableToCompleteException { if(classtype.isInterface() != null && checkImplementedInterface(oracle, classtype.getImplementedInterfaces())) { String fullName = classtype.getQualifiedSourceName(); AutoBeanFactoryGenerator gen = new AutoBeanFactoryGenerator(); return gen.generate(logger, context, fullName); } return null; }
private JClassType getMethodRoot(final JMethod method) { JClassType winner = method.getEnclosingType(); if (winner.isInterface() != null) { for (final JClassType type : winner.getImplementedInterfaces()) { if (type.findMethod(method.getName(), EMPTY_PARAMS) != null) { if (type.isAssignableFrom(winner)) { winner = type; } } } } return winner.getErasedType(); }