@Override public boolean isArray() { return getEnclosedMetaObject().isArray() != null; }
@Override public boolean isArray() { return getEnclosedMetaObject().isArray() != null; }
protected String isArrayEncoderDecoder(JType type, Style style) throws UnableToCompleteException { if (type.isArray() != null) { JType componentType = type.isArray().getComponentType(); if (componentType.isArray() != null) { error("Multi-dimensional arrays are not yet supported"); } String encoderDecoder = getNestedEncoderDecoder(componentType, style); debug("type encoder for: " + componentType + " is " + encoderDecoder); return encoderDecoder; } return null; }
protected String isArrayEncoderDecoder(JType type, Style style) throws UnableToCompleteException { if (type.isArray() != null) { JType componentType = type.isArray().getComponentType(); if (componentType.isArray() != null) { error("Multi-dimensional arrays are not yet supported"); } String encoderDecoder = getNestedEncoderDecoder(componentType, style); debug("type encoder for: " + componentType + " is " + encoderDecoder); return encoderDecoder; } return null; }
private boolean isInnerMostComponentTypeParameter(final JArrayType parm) { final JType componentType = parm.isArray().getComponentType(); if (componentType.isArray() != null) { return isInnerMostComponentTypeParameter(componentType.isArray()); } else { return componentType.isTypeParameter() != null; } }
private boolean isInnerMostComponentTypeParameter(final JArrayType parm) { final JType componentType = parm.isArray().getComponentType(); if (componentType.isArray() != null) { return isInnerMostComponentTypeParameter(componentType.isArray()); } else { return componentType.isTypeParameter() != null; } }
@Override public MetaClass getComponentType() { final JArrayType type = getEnclosedMetaObject().isArray(); if (type == null) { return null; } return newUncachedInstance(oracle, type.getComponentType()); }
@Override public MetaClass getComponentType() { final JArrayType type = getEnclosedMetaObject().isArray(); if (type == null) { return null; } return newUncachedInstance(oracle, type.getComponentType()); }
private boolean isNotBean(JType type) { JClassType collection = typeOracle.findType(Collection.class.getCanonicalName()); JClassType map = typeOracle.findType(Map.class.getCanonicalName()); JClassType number = typeOracle.findType(Number.class.getCanonicalName()); boolean isCollection = false, isMap = false, isNumber = false; if (type instanceof JClassType) { isCollection = ((JClassType) type).isAssignableTo(collection); isMap = ((JClassType) type).isAssignableTo(map); isNumber = ((JClassType) type).isAssignableTo(number); } return type.isPrimitive() != null || type.isEnum() != null || type.isArray() != null || isCollection || isNumber || isMap || type.getSimpleSourceName().equals("String") || type.getSimpleSourceName().equals("Byte") || type.getSimpleSourceName().equals("Short") || type.getSimpleSourceName().equals("Integer") || type.getSimpleSourceName().equals("Long") || type.getSimpleSourceName().equals("Boolean") || type.getSimpleSourceName().equals("Float") || type.getSimpleSourceName().equals("Double") || type.getSimpleSourceName().equals("Number") || type.getSimpleSourceName().equals("Character") || type.getSimpleSourceName().equals("Date") || type.getSimpleSourceName().equals("Timestamp"); }
@Override public MetaField getDeclaredField(final String name) { final JClassType type = getEnclosedMetaObject().isClassOrInterface(); if (type == null) { if ("length".equals(name) && getEnclosedMetaObject().isArray() != null) { return new MetaField.ArrayLengthMetaField(this); } return null; } final JField field = type.findField(name); if (field == null) { return null; } return new GWTField(oracle, field); }
@Override public MetaField getDeclaredField(final String name) { final JClassType type = getEnclosedMetaObject().isClassOrInterface(); if (type == null) { if ("length".equals(name) && getEnclosedMetaObject().isArray() != null) { return new MetaField.ArrayLengthMetaField(this); } return null; } final JField field = type.findField(name); if (field == null) { return null; } return new GWTField(oracle, field); }
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()); } }
public static boolean canContainId(JType type) { if (type != null) { return !(isBoolean(type) || isNumeric(type) || isCharacter(type) || isString(type) || type.isEnum() != null || isDate(type) || type.isArray() != null || isCollection(type) || isJavaType(type) || isGwtType(type)); } return false; }
private String getBinaryOrPrimitiveName(JType type) { JArrayType asArray = type.isArray(); JClassType asClass = type.isClassOrInterface(); JPrimitiveType asPrimitive = type.isPrimitive(); if (asClass != null) { return getBinaryName(asClass); } else if (asPrimitive != null) { return asPrimitive.getQualifiedSourceName(); } else if (asArray != null) { JType componentType = asArray.getComponentType(); return getBinaryOrPrimitiveName(componentType) + "[]"; } else { throw new InternalCompilerException("Cannot create binary name for " + type.getQualifiedSourceName()); } }
private String getBinaryOrPrimitiveName(JType type) { JArrayType asArray = type.isArray(); JClassType asClass = type.isClassOrInterface(); JPrimitiveType asPrimitive = type.isPrimitive(); if (asClass != null) { return getBinaryName(asClass); } else if (asPrimitive != null) { return asPrimitive.getQualifiedSourceName(); } else if (asArray != null) { JType componentType = asArray.getComponentType(); return getBinaryOrPrimitiveName(componentType) + "[]"; } else { throw new InternalCompilerException("Cannot create binary name for " + type.getQualifiedSourceName()); } }
public JClassType getAssociationType(PropertyDescriptor p, boolean useField) { JType type = this.getElementType(p, useField); JArrayType jArray = type.isArray(); if (jArray != null) { return jArray.getComponentType().isClassOrInterface(); } JParameterizedType pType = type.isParameterized(); JClassType[] typeArgs; if (pType == null) { JRawType rType = type.isRawType(); typeArgs = rType.getGenericType().getTypeParameters(); } else { typeArgs = pType.getTypeArgs(); } // it is either a Iterable or a Map use the last type arg. return typeArgs[typeArgs.length - 1].isClassOrInterface(); }