APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.tools.jlink.internal

public final Class ImageResourcesTree

extends Object
Class Inheritance
Imports
jdk.internal.jimage.ImageLocation, .ModuleLink, java.io.DataOutputStream, .IOException, java.nio.ByteBuffer, java.util.ArrayList, .Collections, .Comparator, .HashMap, .HashSet, .List, .Map, .Objects, .Set, .TreeMap, java.util.stream.Collectors

A class to build a sorted tree of Resource paths as a tree of ImageLocation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
pack-priv static class
ImageResourcesTree.Node

Path item tree node.

pack-priv static class
ImageResourcesTree.PackageNode

A 2nd level package directory, "/packages/<package-name>".

pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final ImageResourcesTree.LocationsAdder
private final List<String>

Constructor Summary

AccessConstructor and Description
public
ImageResourcesTree(long offset, BasicImageWriter writer, List<String> paths)

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adderback to summary
private final ImageResourcesTree.LocationsAdder adder
pathsback to summary
private final List<String> paths

Constructor Detail

ImageResourcesTreeback to summary
public ImageResourcesTree(long offset, BasicImageWriter writer, List<String> paths)

Method Detail

addContentback to summary
public void addContent(DataOutputStream out) throws IOException
jdk.tools.jlink.internal back to summary

private final Class ImageResourcesTree.InvalidTreeException

extends Exception
Class Inheritance
Annotations
@SuppressWarnings:serial

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Throwable
fillInStackTrace()

Overrides java.lang.Throwable.fillInStackTrace.

Fills in the execution stack trace.

Constructor Detail

InvalidTreeExceptionback to summary
public InvalidTreeException(ImageResourcesTree.Node badNode)

Method Detail

fillInStackTraceback to summary
public Throwable fillInStackTrace()

Overrides java.lang.Throwable.fillInStackTrace.

Doc from java.lang.Throwable.fillInStackTrace.

Fills in the execution stack trace. This method records within this Throwable object information about the current state of the stack frames for the current thread.

If the stack trace of this Throwable is not writable, calling this method has no effect.

Annotations
@Override
jdk.tools.jlink.internal back to summary

private final Class ImageResourcesTree.LocationsAdder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final List<byte[]>
private long
private final ImageResourcesTree.Tree
private final BasicImageWriter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private int
private List<byte[]>
private int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contentback to summary
private final List<byte[]> content
offsetback to summary
private long offset
treeback to summary
private final ImageResourcesTree.Tree tree
writerback to summary
private final BasicImageWriter writer

Constructor Detail

LocationsAdderback to summary
pack-priv LocationsAdder(ImageResourcesTree.Tree tree, long offset, BasicImageWriter writer)

Method Detail

addLocationsback to summary
private int addLocations(ImageResourcesTree.Node current)
computeContentback to summary
private List<byte[]> computeContent()
computeContentback to summary
private int computeContent(ImageResourcesTree.Node current, Map<String, ImageLocationWriter> outLocations)
jdk.tools.jlink.internal back to summary

pack-priv Class ImageResourcesTree.Node

extends Object
Class Inheritance
Known Direct Subclasses
jdk.tools.jlink.internal.ImageResourcesTree.ResourceNode, jdk.tools.jlink.internal.ImageResourcesTree.PackageNode

Path item tree node.

Field Summary

Modifier and TypeField and Description
private final Map<String, ImageResourcesTree.Node>
private ImageLocationWriter
private final String
private final ImageResourcesTree.Node

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
public ImageResourcesTree.Node
public String
public String
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

childrenback to summary
private final Map<String, ImageResourcesTree.Node> children
locback to summary
private ImageLocationWriter loc
nameback to summary
private final String name
parentback to summary
private final ImageResourcesTree.Node parent

Constructor Detail

Nodeback to summary
private Node(String name, ImageResourcesTree.Node parent)

Method Detail

buildPathback to summary
private static String buildPath(ImageResourcesTree.Node item)
getChildrenback to summary
public ImageResourcesTree.Node getChildren(String name)
getNameback to summary
public String getName()
getPathback to summary
public String getPath()
setLocationback to summary
private void setLocation(ImageLocationWriter loc)
jdk.tools.jlink.internal back to summary

pack-priv final Class ImageResourcesTree.PackageNode

extends Node
Class Inheritance

A 2nd level package directory, "/packages/<package-name>".

While package paths can exist within many modules, for each package there is at most one module in which that package has resources.

For example, the package path java/util exists in both the java.base and java.logging modules. This means both "/packages/java.util/java.base" and "/packages/java.util/java.logging" will exist, but only "java.base" entry will be marked as having content.

When processing module links in non-preview mode, entries marked as preview-only must be ignored.

If all links in a package are preview-only, then the entire package is marked as preview-only, and must be ignored.

Field Summary

Modifier and TypeField and Description
private final List<ModuleLink>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
Inherited from jdk.tools.jlink.internal.ImageResourcesTree.Node:
getChildrengetNamegetPath

Field Detail

Constructor Detail

PackageNodeback to summary
pack-priv PackageNode(String name, List<ModuleLink> moduleLinks, ImageResourcesTree.Node parent)

Method Detail

jdk.tools.jlink.internal back to summary

pack-priv final Class ImageResourcesTree.ResourceNode

extends Node
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from jdk.tools.jlink.internal.ImageResourcesTree.Node:
getChildrengetNamegetPath

Constructor Detail

ResourceNodeback to summary
public ResourceNode(String name, ImageResourcesTree.Node parent)
jdk.tools.jlink.internal back to summary

pack-priv final Class ImageResourcesTree.Tree

extends Object
Class Inheritance

Tree of nodes.

Field Summary

Modifier and TypeField and Description
private final Map<String, ImageResourcesTree.Node>
private ImageResourcesTree.Node
private final List<String>
private static final String
private final ImageResourcesTree.Node

Constructor Summary

AccessConstructor and Description
pack-priv
Tree(List<String> paths)

Method Summary

Modifier and TypeMethod and Description
private void
private ImageResourcesTree.Node
public Map<String, ImageResourcesTree.Node>
public ImageResourcesTree.Node
private int
pkgEndIndex(String s, int i)

private void
processPath(String fullPath, ImageResourcesTree.Node modulesRoot, Map<String, Set<ModuleLink>> packageToModules)

private String
private String
private String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

directAccessback to summary
private final Map<String, ImageResourcesTree.Node> directAccess
packagesRootback to summary
private ImageResourcesTree.Node packagesRoot
pathsback to summary
private final List<String> paths
PREVIEW_PREFIXback to summary
private static final String PREVIEW_PREFIX
rootback to summary
private final ImageResourcesTree.Node root

Constructor Detail

Treeback to summary
pack-priv Tree(List<String> paths)

Method Detail

buildTreeback to summary
private void buildTree()
getDirectoryNodeback to summary
private ImageResourcesTree.Node getDirectoryNode(String name, ImageResourcesTree.Node parent) throws InvalidTreeException
getMapback to summary
public Map<String, ImageResourcesTree.Node> getMap()
getRootback to summary
public ImageResourcesTree.Node getRoot()
pkgEndIndexback to summary
private int pkgEndIndex(String s, int i)
processPathback to summary
private void processPath(String fullPath, ImageResourcesTree.Node modulesRoot, Map<String, Set<ModuleLink>> packageToModules) throws InvalidTreeException
removeRadicalback to summary
private String removeRadical(ImageResourcesTree.Node node)
removeRadicalback to summary
private String removeRadical(String path, String str)
toResourceNameback to summary
private String toResourceName(ImageResourcesTree.Node node)