
com.nedap.archie.paths.PathUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
Basic utilities for use in the archie library
The newest version!
package com.nedap.archie.paths;
import com.nedap.archie.definitions.AdlCodeDefinitions;
import java.util.List;
/**
* Created by pieter.bos on 07/04/16.
*/
public class PathUtil {
public static String getPath(List pathSegments) {
StringBuilder result = new StringBuilder();
if(pathSegments.isEmpty()) {
return "/";
}
for(PathSegment segment: pathSegments) {
result.append("/");
result.append(segment.getNodeName());
if(segment.getNodeId() != null && !segment.getNodeId().equals(AdlCodeDefinitions.PRIMITIVE_NODE_ID)) {
result.append("[");
result.append(segment.getNodeId());
if(segment.hasNumberIndex()) {
result.append(",");
result.append(segment.getIndex().toString());
}
result.append("]");
} else if (segment.hasNumberIndex()) {
result.append("[");
result.append(segment.getIndex());
result.append("]");
}
}
return result.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy