private String getLabel(final URISegment aSegment) { String _xifexpression = null; if ((aSegment instanceof URISegmentWithParameter)) { String _name = ((URISegmentWithParameter)aSegment).getName(); String _plus = ("{" + _name); _xifexpression = (_plus + "}"); } else { _xifexpression = aSegment.getName(); } return _xifexpression; }
public static String getStringValue(Object object, StringBuffer result) { if (object instanceof HasStringValue) { if (object instanceof URI) { List<String> segments = new ArrayList<String>(((URI) object).getSegments().size()); for (URISegment segment : ((URI) object).getSegments()) { segments.add(segment.toString()); } return Joiner.on("/").join(segments); //$NON-NLS-1$ } else if (object instanceof URISegmentWithParameter) { return "{" + ((URISegmentWithParameter) object).getName() + "}"; //$NON-NLS-1$//$NON-NLS-2$ } else if (object instanceof URISegment) { return ((URISegment) object).getName(); } else if (object instanceof PrimitiveProperty) { PrimitiveProperty prop = (PrimitiveProperty) object; result.append(" (name: "); //$NON-NLS-1$ result.append(prop.getName()); result.append(", cardinality: "); //$NON-NLS-1$ result.append(prop.getCardinality()); result.append(", type: "); //$NON-NLS-1$ result.append(prop.getType()); result.append(')'); return result.toString(); } else { return null; } } return object.toString(); }