/** * Gets parameters of the method. * @param node of the javaScript code * @return list of parameters, never {@code null} */ public List<DocParameter> getParameters(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { return comment.getParameters(); } return Collections.<DocParameter>emptyList(); }
public static OffsetRange getOffsetRange(Node node) { return new OffsetRange(node.getStart(), node.getFinish()); }
/** * Gets properties of the object from comment. * @param node of the javaScript code * @return list of properties defined in the comment, never {@code null} */ public List<DocParameter> getProperties(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { return comment.getProperties(); } return Collections.<DocParameter>emptyList(); }
/** * Gets the set of modifiers attached to given node. * @param node examined node * @return {@code Set} of modifiers, never {@code null} */ public Set<JsModifier> getModifiers(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { return comment.getModifiers(); } return Collections.<JsModifier>emptySet(); }
/** * Gets list of super classes defined by documentation for the given node. * @param node examined node * @return {@code List} of super classes, never {@code null} */ public List<Type> getExtends(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { return comment.getExtends(); } return Collections.<Type>emptyList(); }
/** * Says whether is examined node (probably function node) class, constructor or not. * @param node examined node * @return {@code true} if the comment says "it's a class", {@code false} otherwise */ public boolean isClass(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { return comment.isClass(); } return false; }
/** * Says whether is examined node constant. * @param node examined node * @return {@code true} if the comment says "it's a constant", {@code false} otherwise */ public boolean isConstant(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { return comment.isConstant(); } return false; }
/** * Says whether is code at given code depricated or not. * @param node examined node * @return {@code true} if the comment says "it's deprecated", {@code false} otherwise */ public boolean isDeprecated(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { return comment.getDeprecated() != null; } return false; }
/** * Gets documentation for given Node. * @param node of the javaScript code * @return documentation text if any {@code null} otherwise */ public Documentation getDocumentation(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null) { String content = JsDocumentationPrinter.printDocumentation(comment); if (!content.isEmpty()) { return Documentation.create(content); } } return null; }
/** * Gets possible return types get for the node. * @param node of the javaScript code * @return list of potential return types, never {@code null} */ public List<Type> getReturnType(Node node) { JsComment comment = getCommentForOffset(node.getStart(), getCommentBlocks()); if (comment != null && comment.getReturnType() != null) { return comment.getReturnType().getParamTypes(); } return Collections.<Type>emptyList(); }
if (ln.isString()) { result.add(FunctionArgumentAccessor.getDefault().createForString( position, argument.getStart(), ln.getString())); } else if (ln instanceof LiteralNode.ArrayLiteralNode) { for (JsObjectImpl jsObject: functionArguments) { if (jsObject.getOffset() == argument.getStart()) { result.add(FunctionArgumentAccessor.getDefault().createForArray(position, jsObject.getOffset(), jsObject)); break; if (jsObject.getOffset() == argument.getStart()) { result.add(FunctionArgumentAccessor.getDefault().createForAnonymousObject(position, jsObject.getOffset(), jsObject)); break; if(fillName((AccessNode) argument, strFqn)) { result.add(FunctionArgumentAccessor.getDefault().createForReference( position, argument.getStart(), strFqn)); } else { result.add(FunctionArgumentAccessor.getDefault().createForUnknown(position)); if(fillName((IndexNode) argument, strFqn)) { result.add(FunctionArgumentAccessor.getDefault().createForReference( position, argument.getStart(), strFqn)); } else { result.add(FunctionArgumentAccessor.getDefault().createForUnknown(position)); String inName = in.getName(); result.add(FunctionArgumentAccessor.getDefault().createForReference( position, argument.getStart(), Collections.singletonList(inName)));
int aOffset = fqName == null ? lastVisited.getStart() : fqName.get(fqName.size() - 1).getOffsetRange().getEnd(); array.addAssignment(ModelUtils.resolveSemiTypeOfExpression(modelBuilder, lNode), aOffset); for (Node item : aNode.getElementExpressions()) {