protected void emitSee(StringBuilder sb) { for (Marker marker : getComment().getMarkers()) { StringPosition name = marker.getAnnotation(); TypePosition typePosition = marker.getType(); StringPosition descriptionPosition = marker.getDescription(); StringBuilder desc = new StringBuilder(); // XXX Figure out how to toString() a TypePosition Node for markers // XXX Figure out how to get a @param name form the Marker if (!name.getItem().equals("see")) continue; desc.append(name.getItem()); desc.append(" "); if (typePosition != null) { //desc.append(typePosition.getItem().getString()); //desc.append(" "); } if (descriptionPosition != null) { desc.append(descriptionPosition.getItem()); desc.append(" "); } sb.append(indent); sb.append(" * @").append(desc.toString()).append("\n"); } }
/** * Adds a marker to the documentation (if it exists) and * returns the marker. Returns null otherwise. */ Marker addMarker() { if (!lazyInitDocumentation()) { return null; } if (documentation.markers == null) { documentation.markers = new ArrayList<Marker>(); } Marker marker = new Marker(); documentation.markers.add(marker); return marker; }
SourcePosition<Node> pos = marker.getNameNode(); if (pos == null) { continue; SourcePosition<Node> typePos = marker.getType(); JSType type = null; if (typePos != null) {
SourcePosition<Node> pos = marker.getNameNode(); if (pos == null) { continue; SourcePosition<Node> typePos = marker.getType(); JSType type = null; if (typePos != null) {
/** * Adds a name declaration to the current marker. */ public void markName(String name, StaticSourceFile file, int lineno, int charno) { if (currentMarker != null) { // Record the name as both a SourcePosition<String> and a // SourcePosition<Node>. The <String> form is deprecated, // because <Node> is more consistent with how other name // references are handled (see #markTypeNode) // // TODO(nicksantos): Remove all uses of the Name position // and replace them with the NameNode position. JSDocInfo.TrimmedStringPosition position = new JSDocInfo.TrimmedStringPosition(); position.setItem(name); position.setPositionInformation(lineno, charno, lineno, charno + name.length()); currentMarker.setName(position); JSDocInfo.NamePosition nodePos = new JSDocInfo.NamePosition(); Node node = Node.newString(Token.NAME, name, lineno, charno); node.setLength(name.length()); node.setStaticSourceFile(file); nodePos.setItem(node); nodePos.setPositionInformation(lineno, charno, lineno, charno + name.length()); currentMarker.setNameNode(nodePos); } }
/** * Adds a name declaration to the current marker. */ public void markName(String name, Node templateNode, int lineno, int charno) { if (currentMarker != null) { // Record the name as both a SourcePosition<String> and a // SourcePosition<Node>. The <String> form is deprecated, // because <Node> is more consistent with how other name // references are handled (see #markTypeNode) // // TODO(nicksantos): Remove all uses of the Name position // and replace them with the NameNode position. JSDocInfo.TrimmedStringPosition position = new JSDocInfo.TrimmedStringPosition(); position.setItem(name); position.setPositionInformation(lineno, charno, lineno, charno + name.length()); JSDocInfo.NamePosition nodePos = new JSDocInfo.NamePosition(); Node node = Node.newString(Token.NAME, name, lineno, charno); node.setLength(name.length()); if (templateNode != null) { node.setStaticSourceFileFrom(templateNode); } nodePos.setItem(node); nodePos.setPositionInformation(lineno, charno, lineno, charno + name.length()); currentMarker.setNameNode(nodePos); } }
protected void emitSee(StringBuilder sb) { for (Marker marker : getComment().getMarkers()) { StringPosition name = marker.getAnnotation(); TypePosition typePosition = marker.getType(); StringPosition descriptionPosition = marker.getDescription(); StringBuilder desc = new StringBuilder(); // XXX Figure out how to toString() a TypePosition Node for markers // XXX Figure out how to get a @param name form the Marker if (!name.getItem().equals("see")) continue; desc.append(name.getItem()); desc.append(" "); if (typePosition != null) { //desc.append(typePosition.getItem().getString()); //desc.append(" "); } if (descriptionPosition != null) { desc.append(descriptionPosition.getItem()); desc.append(" "); } sb.append(indent); sb.append(" * @").append(desc.toString()).append("\n"); } }
protected void emitSee(StringBuilder sb) { for (Marker marker : getComment().getMarkers()) { StringPosition name = marker.getAnnotation(); TypePosition typePosition = marker.getType(); StringPosition descriptionPosition = marker.getDescription(); StringBuilder desc = new StringBuilder(); // XXX Figure out how to toString() a TypePosition Node for markers // XXX Figure out how to get a @param name form the Marker if (!name.getItem().equals("see")) continue; desc.append(name.getItem()); desc.append(" "); if (typePosition != null) { //desc.append(typePosition.getItem().getString()); //desc.append(" "); } if (descriptionPosition != null) { desc.append(descriptionPosition.getItem()); desc.append(" "); } sb.append(indent); sb.append(" * @").append(desc.toString()).append("\n"); } }
/** * Adds a marker to the current JSDocInfo and populates the marker with the * annotation information. */ public void markAnnotation(String annotation, int lineno, int charno) { JSDocInfo.Marker marker = currentInfo.addMarker(); if (marker != null) { JSDocInfo.TrimmedStringPosition position = new JSDocInfo.TrimmedStringPosition(); position.setItem(annotation); position.setPositionInformation(lineno, charno, lineno, charno + annotation.length()); marker.setAnnotation(position); populated = true; } currentMarker = marker; }
public FieldReference(ReferenceModel model, ClassReference classReference, Node node, String name, JSDocInfo comment, boolean isStatic) { super(model, classReference, node, name, comment); Collection<Marker> markers = comment.getMarkers(); Marker[] markerArray = new Marker[markers.size()]; for (Marker marker : markers) { if (marker.getAnnotation().getItem().equals("const")) this.isConst = true; } TrueConstant constant = isTrueConstant(); if (constant != null) constantValue = constant.getValue(); this.isStatic = isStatic; }
/** * Adds a marker to the current JSDocInfo and populates the marker with the * annotation information. */ public void markAnnotation(String annotation, int lineno, int charno) { JSDocInfo.Marker marker = currentInfo.addMarker(); if (marker != null) { JSDocInfo.TrimmedStringPosition position = new JSDocInfo.TrimmedStringPosition(); position.setItem(annotation); position.setPositionInformation(lineno, charno, lineno, charno + annotation.length()); marker.setAnnotation(position); populated = true; } currentMarker = marker; }
public FieldReference(ReferenceModel model, ClassReference classReference, Node node, String name, JSDocInfo comment, boolean isStatic) { super(model, classReference, node, name, comment); Collection<Marker> markers = comment.getMarkers(); for (Marker marker : markers) { if (marker.getAnnotation().getItem().equals("const")) this.isConst = true; } TrueConstant constant = isTrueConstant(); if (constant != null) constantValue = constant.getValue(); this.isStatic = isStatic; }
/** * Adds a type declaration to the current marker. */ public void markTypeNode(Node typeNode, int lineno, int startCharno, int endLineno, int endCharno, boolean hasLC) { if (currentMarker != null) { JSDocInfo.TypePosition position = new JSDocInfo.TypePosition(); position.setItem(typeNode); position.setHasBrackets(hasLC); position.setPositionInformation(lineno, startCharno, endLineno, endCharno); currentMarker.setType(position); } }
/** * Adds a marker to the documentation (if it exists) and * returns the marker. Returns null otherwise. */ Marker addMarker() { if (!lazyInitDocumentation()) { return null; } if (documentation.markers == null) { documentation.markers = new ArrayList<>(); } Marker marker = new Marker(); documentation.markers.add(marker); return marker; }
/** * Adds a type declaration to the current marker. */ public void markTypeNode(Node typeNode, int lineno, int startCharno, int endLineno, int endCharno, boolean hasLC) { if (currentMarker != null) { JSDocInfo.TypePosition position = new JSDocInfo.TypePosition(); position.setItem(typeNode); position.setHasBrackets(hasLC); position.setPositionInformation(lineno, startCharno, endLineno, endCharno); currentMarker.setType(position); } }
/** * Adds a textual block to the current marker. */ public void markText(String text, int startLineno, int startCharno, int endLineno, int endCharno) { if (currentMarker != null) { JSDocInfo.StringPosition position = new JSDocInfo.StringPosition(); position.setItem(text); position.setPositionInformation(startLineno, startCharno, endLineno, endCharno); currentMarker.setDescription(position); } }
/** * Adds a textual block to the current marker. */ public void markText(String text, int startLineno, int startCharno, int endLineno, int endCharno) { if (currentMarker != null) { JSDocInfo.StringPosition position = new JSDocInfo.StringPosition(); position.setItem(text); position.setPositionInformation(startLineno, startCharno, endLineno, endCharno); currentMarker.setDescription(position); } }