/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
recursiveJarDirectories.putValue(rootType, url);
}
}
- for (Element rootsElement : JDOMUtil.getChildren(libraryElement)) {
+ for (Element rootsElement : libraryElement.getChildren()) {
final String rootTypeId = rootsElement.getName();
if (!rootTypeId.equals(JAR_DIRECTORY_TAG)) {
final JpsOrderRootType rootType = getRootType(rootTypeId);
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.jetbrains.jps.model.java.JpsJavaExtensionService;
import org.jetbrains.jps.model.java.JpsJavaSdkType;
import org.jetbrains.jps.model.java.JpsJavaSdkTypeWrapper;
-import org.jetbrains.jps.model.library.*;
+import org.jetbrains.jps.model.library.JpsLibrary;
+import org.jetbrains.jps.model.library.JpsLibraryCollection;
+import org.jetbrains.jps.model.library.JpsLibraryRoot;
+import org.jetbrains.jps.model.library.JpsOrderRootType;
import org.jetbrains.jps.model.library.sdk.JpsSdk;
-import org.jetbrains.jps.model.library.sdk.JpsSdkType;
import org.jetbrains.jps.model.library.sdk.JpsSdkReference;
+import org.jetbrains.jps.model.library.sdk.JpsSdkType;
import org.jetbrains.jps.model.module.JpsSdkReferencesTable;
import org.jetbrains.jps.model.serialization.JpsModelSerializerExtension;
for (Element rootTypeElement : JDOMUtil.getChildren(roots)) {
JpsLibraryRootTypeSerializer rootTypeSerializer = getRootTypeSerializer(rootTypeElement.getName());
if (rootTypeSerializer != null) {
- for (Element rootElement : JDOMUtil.getChildren(rootTypeElement)) {
+ for (Element rootElement : rootTypeElement.getChildren()) {
loadRoots(rootElement, library, rootTypeSerializer.getType());
}
}
private static void loadRoots(Element rootElement, JpsLibrary library, JpsOrderRootType rootType) {
final String type = rootElement.getAttributeValue(TYPE_ATTRIBUTE);
if (type.equals(COMPOSITE_TYPE)) {
- for (Element element : JDOMUtil.getChildren(rootElement)) {
+ for (Element element : rootElement.getChildren()) {
loadRoots(element, library, rootType);
}
}
}
@NotNull
- public static String writeChildren(@Nullable final Element element, @NotNull final String lineSeparator) {
- try {
- final StringWriter writer = new StringWriter();
- for (Element child : getChildren(element)) {
- writeElement(child, writer, lineSeparator);
- writer.append(lineSeparator);
- }
- return writer.toString();
- }
- catch (IOException e) {
- throw new RuntimeException(e);
+ public static String writeChildren(@NotNull final Element element, @NotNull final String lineSeparator) throws IOException {
+ final StringWriter writer = new StringWriter();
+ for (Element child : element.getChildren()) {
+ writeElement(child, writer, lineSeparator);
+ writer.append(lineSeparator);
}
+ return writer.toString();
}
public static void writeDocument(@NotNull Document document, @NotNull Writer writer, String lineSeparator) throws IOException {
System.err.println(prefix);
}
- List<Element> children = getChildren(element);
- for (final Element child : children) {
+ for (final Element child : element.getChildren()) {
printDiagnostics(child, prefix);
}
}