/** * Records a thrown type. */ public boolean recordThrowType(JSTypeExpression type) { if (type != null && !hasAnySingletonTypeTags()) { currentInfo.declareThrows(type); populated = true; return true; } return false; }
/** * Records a thrown type. */ public boolean recordThrowType(JSTypeExpression type) { if (type != null && !hasAnySingletonTypeTags()) { currentInfo.declareThrows(type); populated = true; return true; } return false; }
/** * Changes a base type, even if one has already been set on currentInfo. * * @return {@code true} if the base type was changed successfully. */ public boolean changeBaseType(JSTypeExpression jsType) { if (jsType != null && !hasAnySingletonTypeTags()) { currentInfo.setBaseType(jsType); populated = true; return true; } else { return false; } }
/** * Changes a base type, even if one has already been set on currentInfo. * * @return {@code true} if the base type was changed successfully. */ public boolean changeBaseType(JSTypeExpression jsType) { if (jsType != null && !hasAnySingletonTypeTags()) { currentInfo.setBaseType(jsType); populated = true; return true; } else { return false; } }
/** * Records a typed parameter. * * @return {@code true} if the typed parameter was recorded and * {@code false} if a parameter with the same name was already defined */ public boolean recordParameter(String parameterName, JSTypeExpression type) { if (!hasAnySingletonTypeTags() && currentInfo.declareParam(type, parameterName)) { populated = true; return true; } else { return false; } }
/** * Records a typed parameter. * * @return {@code true} if the typed parameter was recorded and * {@code false} if a parameter with the same name was already defined */ public boolean recordParameter(String parameterName, JSTypeExpression type) { if (!hasAnySingletonTypeTags() && currentInfo.declareParam(type, parameterName)) { populated = true; return true; } else { return false; } }
/** * Records a base type. * * @return {@code true} if the base type was recorded and {@code false} * if it was already defined */ public boolean recordBaseType(JSTypeExpression jsType) { if (jsType != null && !hasAnySingletonTypeTags() && !currentInfo.hasBaseType()) { currentInfo.setBaseType(jsType); populated = true; return true; } else { return false; } }
/** * Records a type for {@code @this} annotation. * * @return {@code true} if the type was recorded and * {@code false} if it is invalid or if it collided with {@code @enum} or * {@code @type} annotations */ public boolean recordThisType(JSTypeExpression type) { if (type != null && !hasAnySingletonTypeTags() && !currentInfo.hasThisType()) { currentInfo.setThisType(type); populated = true; return true; } else { return false; } }
/** * Records a type for {@code @this} annotation. * * @return {@code true} if the type was recorded and * {@code false} if it is invalid or if it collided with {@code @enum} or * {@code @type} annotations */ public boolean recordThisType(JSTypeExpression type) { if (type != null && !hasAnySingletonTypeTags() && !currentInfo.hasThisType()) { currentInfo.setThisType(type); populated = true; return true; } else { return false; } }
/** * Records a return type. * * @return {@code true} if the return type was recorded and {@code false} if * it is invalid or was already defined */ public boolean recordReturnType(JSTypeExpression jsType) { if (jsType != null && currentInfo.getReturnType() == null && !hasAnySingletonTypeTags()) { currentInfo.setReturnType(jsType); populated = true; return true; } else { return false; } }
/** * Records a return type. * * @return {@code true} if the return type was recorded and {@code false} if * it is invalid or was already defined */ public boolean recordReturnType(JSTypeExpression jsType) { if (jsType != null && currentInfo.getReturnType() == null && !hasAnySingletonTypeTags()) { currentInfo.setReturnType(jsType); populated = true; return true; } else { return false; } }
/** * Records that the {@link JSDocInfo} being built should have its * {@link JSDocInfo#makesStructs()} flag set to {@code true}. * * @return {@code true} if the struct was recorded and {@code false} * if it was already defined or it was incompatible with the existing flags */ public boolean recordStruct() { if (hasAnySingletonTypeTags() || currentInfo.makesDicts() || currentInfo.makesStructs() || currentInfo.makesUnrestricted()) { return false; } currentInfo.setStruct(); populated = true; return true; }
/** * Records that the {@link JSDocInfo} being built should have its * {@link JSDocInfo#makesDicts()} flag set to {@code true}. * * @return {@code true} if the dict was recorded and {@code false} * if it was already defined or it was incompatible with the existing flags */ public boolean recordDict() { if (hasAnySingletonTypeTags() || currentInfo.makesDicts() || currentInfo.makesStructs() || currentInfo.makesUnrestricted()) { return false; } currentInfo.setDict(); populated = true; return true; }
/** * Records that the {@link JSDocInfo} being built should have its * {@link JSDocInfo#makesStructs()} flag set to {@code true}. * * @return {@code true} if the struct was recorded and {@code false} * if it was already defined or it was incompatible with the existing flags */ public boolean recordStruct() { if (hasAnySingletonTypeTags() || currentInfo.makesDicts() || currentInfo.makesStructs() || currentInfo.makesUnrestricted()) { return false; } currentInfo.setStruct(); populated = true; return true; }
/** * Records that the {@link JSDocInfo} being built should have its * {@link JSDocInfo#makesDicts()} flag set to {@code true}. * * @return {@code true} if the dict was recorded and {@code false} * if it was already defined or it was incompatible with the existing flags */ public boolean recordDict() { if (hasAnySingletonTypeTags() || currentInfo.makesDicts() || currentInfo.makesStructs() || currentInfo.makesUnrestricted()) { return false; } currentInfo.setDict(); populated = true; return true; }
/** * Records that the {@link JSDocInfo} being built should have its * {@link JSDocInfo#makesUnrestricted()} flag set to {@code true}. * * @return {@code true} if annotation was recorded and {@code false} * if it was already defined or it was incompatible with the existing flags */ public boolean recordUnrestricted() { if (hasAnySingletonTypeTags() || currentInfo.isInterface() || currentInfo.makesDicts() || currentInfo.makesStructs() || currentInfo.makesUnrestricted()) { return false; } currentInfo.setUnrestricted(); populated = true; return true; }
/** * Records that the {@link JSDocInfo} being built should have its * {@link JSDocInfo#makesUnrestricted()} flag set to {@code true}. * * @return {@code true} if annotation was recorded and {@code false} * if it was already defined or it was incompatible with the existing flags */ public boolean recordUnrestricted() { if (hasAnySingletonTypeTags() || currentInfo.isInterface() || currentInfo.makesDicts() || currentInfo.makesStructs() || currentInfo.makesUnrestricted()) { return false; } currentInfo.setUnrestricted(); populated = true; return true; }
/** * Records that the {@link JSDocInfo} being built should have its * {@link JSDocInfo#isAbstract()} flag set to {@code true}. * * @return {@code true} if the flag was recorded and {@code false} * if it was already defined or it was incompatible with the existing flags */ public boolean recordAbstract() { if (!hasAnySingletonTypeTags() && !currentInfo.isInterface() && !currentInfo.isAbstract() && !currentInfo.isFinal() && currentInfo.getVisibility() != Visibility.PRIVATE) { currentInfo.setAbstract(); populated = true; return true; } return false; }
/** * Whether the current doc info has other type tags, like * {@code @param} or {@code @return} or {@code @type} or etc. */ private boolean hasAnyTypeRelatedTags() { return currentInfo.isConstructor() || currentInfo.isInterface() || currentInfo.getParameterCount() > 0 || currentInfo.hasReturnType() || currentInfo.hasBaseType() || currentInfo.getExtendedInterfacesCount() > 0 || currentInfo.getLendsName() != null || currentInfo.hasThisType() || hasAnySingletonTypeTags(); }
/** * Whether the current doc info has other type tags, like * {@code @param} or {@code @return} or {@code @type} or etc. */ private boolean hasAnyTypeRelatedTags() { return currentInfo.isConstructor() || currentInfo.isInterface() || currentInfo.isAbstract() || currentInfo.getParameterCount() > 0 || currentInfo.hasReturnType() || currentInfo.hasBaseType() || currentInfo.getExtendedInterfacesCount() > 0 || currentInfo.hasLendsName() || currentInfo.hasThisType() || hasAnySingletonTypeTags(); }