< prev index next >
src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java
Print this page
*** 54,64 ****
private final InputStream in;
// the packages in the ModulePackages attribute
private Set<String> packages;
! // the value of the module_version in Module attribute
private Version version;
// the value of the ModuleMainClass attribute
private String mainClass;
--- 54,64 ----
private final InputStream in;
// the packages in the ModulePackages attribute
private Set<String> packages;
! // the value for the module version in the Module attribute
private Version version;
// the value of the ModuleMainClass attribute
private String mainClass;
*** 76,102 ****
private ModuleInfoExtender(InputStream in) {
this.in = in;
}
/**
! * Sets the set of packages for the ModulePackages attribute
*/
public ModuleInfoExtender packages(Set<String> packages) {
this.packages = Collections.unmodifiableSet(packages);
return this;
}
/**
! * Sets the value of the module_version in Module attribute.
*/
public ModuleInfoExtender version(Version version) {
this.version = version;
return this;
}
/**
* Sets the value of the ModuleMainClass attribute.
*/
public ModuleInfoExtender mainClass(String mainClass) {
this.mainClass = mainClass;
return this;
}
--- 76,109 ----
private ModuleInfoExtender(InputStream in) {
this.in = in;
}
/**
! * Sets the packages for the ModulePackages attribute
! *
! * @apiNote This method does not check that the package names are legal
! * package names or that the set of packages is a super set of the
! * packages in the module.
*/
public ModuleInfoExtender packages(Set<String> packages) {
this.packages = Collections.unmodifiableSet(packages);
return this;
}
/**
! * Sets the value for the module version in the Module attribute
*/
public ModuleInfoExtender version(Version version) {
this.version = version;
return this;
}
/**
* Sets the value of the ModuleMainClass attribute.
+ *
+ * @apiNote This method does not check that the main class is a legal
+ * class name in a named package.
*/
public ModuleInfoExtender mainClass(String mainClass) {
this.mainClass = mainClass;
return this;
}
*** 131,141 ****
return this;
}
/**
* A ClassVisitor that supports adding class file attributes. If an
! * attribute already exists then the first occurence of the attribute
* is replaced.
*/
private static class AttributeAddingClassVisitor extends ClassVisitor {
private Map<String, Attribute> attrs = new HashMap<>();
--- 138,148 ----
return this;
}
/**
* A ClassVisitor that supports adding class file attributes. If an
! * attribute already exists then the first occurrence of the attribute
* is replaced.
*/
private static class AttributeAddingClassVisitor extends ClassVisitor {
private Map<String, Attribute> attrs = new HashMap<>();
< prev index next >