use of org.jdom.Element in project intellij-leiningen-plugin by derkork.
the class LeiningenRunConfiguration method readExternal.
@Override
public void readExternal(Element element) throws InvalidDataException {
super.readExternal(element);
final Element child = element.getChild("LeiningenRunnerParameters");
if (child != null) {
myRunnerParams = XmlSerializer.deserialize(child, LeiningenRunnerParameters.class);
}
}
use of org.jdom.Element in project che by eclipse.
the class MavenWorkspace method addSourcePathFromConfiguration.
private void addSourcePathFromConfiguration(ClasspathHelper helper, MavenProject project, Element configuration, List<String> attributes) {
if (configuration != null) {
Element sources = configuration.getChild("sources");
if (sources != null) {
for (Object element : sources.getChildren()) {
final String path = ((Element) element).getTextTrim();
final IPath projectLocation = project.getProject().getLocation();
final String projectPath = projectLocation.toOSString();
final String sourceFolder = path.contains(projectPath) ? path.substring(projectPath.length() + 1) : path;
helper.addSourceEntry(project.getProject().getFullPath().append(sourceFolder));
if (!attributes.contains(sourceFolder)) {
attributes.add(sourceFolder);
}
}
}
}
}
use of org.jdom.Element in project freud by LMAX-Exchange.
the class ClassDeclarationJdom method getMethodDeclarationListByNameMap.
private void getMethodDeclarationListByNameMap(final JXPathContext context) {
List<Element> methodDeclElementList = context.selectNodes("//" + FUNCTION_METHOD_DECL.getName() + "|//" + VOID_METHOD_DECL.getName());
for (Element methodElement : methodDeclElementList) {
MethodDeclaration methodDeclaration = new MethodDeclarationJdom(methodElement, this);
final String name = methodDeclaration.getName();
List<MethodDeclaration> methodDeclarationList = methodDeclarationListByNameMap.get(name);
if (methodDeclarationList == null) {
methodDeclarationList = new LinkedList<MethodDeclaration>();
methodDeclarationListByNameMap.put(name, methodDeclarationList);
}
methodDeclarationList.add(methodDeclaration);
}
}
use of org.jdom.Element in project freud by LMAX-Exchange.
the class ClassDeclarationJdom method getSuperClassName.
public String getSuperClassName() {
if (superClassName == NOT_RETRIEVED) {
JXPathContext context = JXPathContext.newContext(classDeclElement);
final Element superClassElement = (Element) context.selectSingleNode("/" + EXTENDS_CLAUSE.getName() + "//" + IDENT.getName());
superClassName = (null == superClassElement) ? null : superClassElement.getValue();
}
return superClassName;
}
use of org.jdom.Element in project freud by LMAX-Exchange.
the class CodeBlockJdom method getMethodCallByMethodNameMap.
@Override
@SuppressWarnings("unchecked")
public Map<String, List<MethodCall>> getMethodCallByMethodNameMap() {
if (methodCallByMethodNameMap == null) {
methodCallByMethodNameMap = new HashMap<String, List<MethodCall>>();
JXPathContext context = JXPathContext.newContext(codeBlockElement);
List<Element> methodCallElementList = context.selectNodes("//" + JavaSourceTokenType.METHOD_CALL.getName());
for (Element methodCallElement : methodCallElementList) {
final MethodCall methodCall = new MethodCallJdom(methodCallElement);
List<MethodCall> methodCallList = methodCallByMethodNameMap.get(methodCall.getMethodName());
if (methodCallList == null) {
methodCallList = new LinkedList<MethodCall>();
methodCallByMethodNameMap.put(methodCall.getMethodName(), methodCallList);
}
methodCallList.add(methodCall);
}
}
return methodCallByMethodNameMap;
}
Aggregations