public TypeReference toTypeReference() { return getUserData(Keys.TYPE_REFERENCE); }
private static boolean referencesType(final AstType reference, final TypeReference localType) { return reference != null && referencesType(reference.getUserData(Keys.TYPE_REFERENCE), localType); }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof AstType) { final TypeReference otherType = ((AstType) other).getUserData(Keys.TYPE_REFERENCE); return otherType != null && _type.isEquivalentTo(otherType); } return false; } }
@Override public ResolveResult visitTypeReference(final TypeReferenceExpression node, final Void p) { return resolveType(node.getType().getUserData(Keys.TYPE_REFERENCE)); }
@Override public ResolveResult visitTypeReference(final TypeReferenceExpression node, final Void _) { return resolveType(node.getType().getUserData(Keys.TYPE_REFERENCE)); }
@Override public ResolveResult visitTypeReference(final TypeReferenceExpression node, final Void _) { return resolveType(node.getType().getUserData(Keys.TYPE_REFERENCE)); }
private static boolean referencesType(final AstType reference, final TypeReference localType) { return reference != null && referencesType(reference.getUserData(Keys.TYPE_REFERENCE), localType); }
private static boolean referencesType(final AstType reference, final TypeReference localType) { return reference != null && referencesType(reference.getUserData(Keys.TYPE_REFERENCE), localType); }
public TypeReferenceExpression makeReference() { final TypeReferenceExpression t = new TypeReferenceExpression(Expression.MYSTERY_OFFSET, this); final TypeReference r = getUserData(Keys.TYPE_REFERENCE); if (r != null) { t.putUserData(Keys.TYPE_REFERENCE, r); } return t; }
@Override public Void visitObjectCreationExpression(final ObjectCreationExpression node, final Void _) { super.visitObjectCreationExpression(node, _); final TypeReference type = node.getType().getUserData(Keys.TYPE_REFERENCE); final TypeDefinition resolvedType = type != null ? type.resolve() : null; if (resolvedType != null && isLocalOrAnonymous(resolvedType)) { List<ObjectCreationExpression> instantiations = _instantiations.get(type); if (instantiations == null) { _instantiations.put(type, instantiations = new ArrayList<>()); } instantiations.add(node); } return null; }
@Deprecated public boolean test(final Annotation a) { final TypeReference t = a.getType().getUserData(Keys.TYPE_REFERENCE); return t != null && StringUtilities.equals(t.getInternalName(), DEPRECATED_ANNOTATION_NAME); } };
@Override public boolean test(final Annotation a) { final TypeReference t = a.getType().getUserData(Keys.TYPE_REFERENCE); return t != null && StringUtilities.equals(t.getInternalName(), OVERRIDE_ANNOTATION_NAME); } };
@Override public boolean matches(final INode other, final Match match) { if (other instanceof TypeReferenceExpression) { final TypeReferenceExpression typeReferenceExpression = (TypeReferenceExpression) other; final TypeReference typeReference = typeReferenceExpression.getType().getUserData(Keys.TYPE_REFERENCE); return typeReference != null && StringUtilities.equals(_descriptor, typeReference.getInternalName()); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof TypeReferenceExpression) { final TypeReferenceExpression typeReferenceExpression = (TypeReferenceExpression) other; final TypeReference typeReference = typeReferenceExpression.getType().getUserData(Keys.TYPE_REFERENCE); return typeReference != null && StringUtilities.equals(_descriptor, typeReference.getInternalName()); } return false; } }
public AstType makeArrayType() { final ComposedType composedType = new ComposedType(); composedType.setBaseType(this); final TypeReference typeReference = getUserData(Keys.TYPE_REFERENCE); if (typeReference != null) { composedType.putUserData(Keys.TYPE_REFERENCE, typeReference); } composedType.makeArrayType(); return composedType; }
public AstType makeArrayType() { final ComposedType composedType = new ComposedType(); composedType.setBaseType(this); final TypeReference typeReference = getUserData(Keys.TYPE_REFERENCE); if (typeReference != null) { composedType.putUserData(Keys.TYPE_REFERENCE, typeReference); } composedType.makeArrayType(); return composedType; }
public AstType makeArrayType() { final ComposedType composedType = new ComposedType(); composedType.setBaseType(this); final TypeReference typeReference = getUserData(Keys.TYPE_REFERENCE); if (typeReference != null) { composedType.putUserData(Keys.TYPE_REFERENCE, typeReference); } composedType.makeArrayType(); return composedType; }
@Override public ResolveResult visitClassOfExpression(final ClassOfExpression node, final Void data) { final TypeReference type = node.getType().getUserData(Keys.TYPE_REFERENCE); if (type == null) { return null; } if (BuiltinTypes.Class.isGenericType()) { return new ResolveResult(BuiltinTypes.Class.makeGenericType(type)); } return new ResolveResult(BuiltinTypes.Class); }
@Override public ResolveResult visitClassOfExpression(final ClassOfExpression node, final Void data) { final TypeReference type = node.getType().getUserData(Keys.TYPE_REFERENCE); if (type == null) { return null; } if (BuiltinTypes.Class.isGenericType()) { return new ResolveResult(BuiltinTypes.Class.makeGenericType(type)); } return new ResolveResult(BuiltinTypes.Class); }
@Override public ResolveResult visitClassOfExpression(final ClassOfExpression node, final Void data) { final TypeReference type = node.getType().getUserData(Keys.TYPE_REFERENCE); if (type == null) { return null; } if (BuiltinTypes.Class.isGenericType()) { return new ResolveResult(BuiltinTypes.Class.makeGenericType(type)); } return new ResolveResult(BuiltinTypes.Class); }