private String getName(Concept concept) { String name = concept.getName().toString(); String parent = null; if (concept instanceof StructMember) { StructMember member = (StructMember) concept; parent = member.getDeclaringType().getName().toString(); } else if (concept instanceof Method) { Method method = (Method) concept; parent = method.getDeclaringService().getName().toString(); } if (parent != null) { name = parent + "/" + name; } return name; }
private String getTypeRef(Type type) { if (type instanceof StructType || type instanceof PrimitiveType || type instanceof EnumType) { return type.getName().toString(); } if (type instanceof ListType) { ListType listType = (ListType) type; Type elementType = listType.getElementType(); return getTypeRef(elementType) + "[]"; } return ""; }
@Override public void exitBooleanBinaryTerm(BooleanBinaryTermContext context) { BinaryExpression result = new BinaryExpression(); result.setOperator(Operator.OR); result.setLeft(context.left.result); result.setRight(context.right.result); context.result = result; }
/** * Generates a string representation of this annotation, usually just its name. */ @Override public String toString() { return name != null? name.toString(): ""; }
/** * Generates the string representation of the string, assuming that it is going to be used in a place that doesn't * require parenthesis. If this isn't the case consider using the {@link #toString(boolean)} method, passing the * {@code true} as the value of the {@code protect} parameter. */ @Override public String toString() { return toString(false); } }
public void setType(Type type) { if (member==null) { member = new StructMember(); } member.setType(type); } public Name getName() {
@Override public String toString() { return elementType.toString() + "[]"; } }
private String getTypeRef(Type type) { if (type instanceof StructType || type instanceof PrimitiveType || type instanceof EnumType) { return type.getName().toString(); } if (type instanceof ListType) { ListType listType = (ListType) type; Type elementType = listType.getElementType(); return getTypeRef(elementType) + "[]"; } return ""; }
@Override public void exitBooleanBinaryFactor(BooleanBinaryFactorContext context) { BinaryExpression result = new BinaryExpression(); result.setOperator(Operator.AND); result.setLeft(context.left.result); result.setRight(context.right.result); context.result = result; }
/** * Generates a string representation of this annotation, usually just its name. */ @Override public String toString() { return name != null? name.toString(): ""; }
/** * Return true if this method has any 'action' (e.g: install) as its base. * Methods which have a base method represent 'signatures' of the same method. */ public boolean isActionSignature(Method method) { return method.getBase()!=null && !method.getBase().getName().equals(ADD) && !method.getBase().getName().equals(UPDATE); }
/** * Generates a string representation of this concept, usually just its name. */ @Override public String toString() { return name != null? name.toString(): ""; }