jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java
changeset 45004 ea3137042a61
parent 44359 c6761862ca0b
equal deleted inserted replaced
44789:73fd39e0702e 45004:ea3137042a61
    60     private Version version;
    60     private Version version;
    61 
    61 
    62     // the value of the ModuleMainClass attribute
    62     // the value of the ModuleMainClass attribute
    63     private String mainClass;
    63     private String mainClass;
    64 
    64 
    65     // the values for the ModuleTarget attribute
    65     // the value for the ModuleTarget attribute
    66     private String osName;
    66     private String targetPlatform;
    67     private String osArch;
       
    68 
    67 
    69     // the hashes for the ModuleHashes attribute
    68     // the hashes for the ModuleHashes attribute
    70     private ModuleHashes hashes;
    69     private ModuleHashes hashes;
    71 
    70 
    72     // the value of the ModuleResolution attribute
    71     // the value of the ModuleResolution attribute
   106         this.mainClass = mainClass;
   105         this.mainClass = mainClass;
   107         return this;
   106         return this;
   108     }
   107     }
   109 
   108 
   110     /**
   109     /**
   111      * Sets the values for the ModuleTarget attribute.
   110      * Sets the value for the ModuleTarget attribute.
   112      */
   111      */
   113     public ModuleInfoExtender targetPlatform(String osName, String osArch) {
   112     public ModuleInfoExtender targetPlatform(String targetPlatform) {
   114         this.osName = osName;
   113         this.targetPlatform = targetPlatform;
   115         this.osArch = osArch;
       
   116         return this;
   114         return this;
   117     }
   115     }
   118 
   116 
   119     /**
   117     /**
   120      * The ModuleHashes attribute will be emitted to the module-info with
   118      * The ModuleHashes attribute will be emitted to the module-info with
   197 
   195 
   198         if (packages != null)
   196         if (packages != null)
   199             cv.addAttribute(new ModulePackagesAttribute(packages));
   197             cv.addAttribute(new ModulePackagesAttribute(packages));
   200         if (mainClass != null)
   198         if (mainClass != null)
   201             cv.addAttribute(new ModuleMainClassAttribute(mainClass));
   199             cv.addAttribute(new ModuleMainClassAttribute(mainClass));
   202         if (osName != null || osArch != null)
   200         if (targetPlatform != null)
   203             cv.addAttribute(new ModuleTargetAttribute(osName, osArch));
   201             cv.addAttribute(new ModuleTargetAttribute(targetPlatform));
   204         if (hashes != null)
   202         if (hashes != null)
   205             cv.addAttribute(new ModuleHashesAttribute(hashes));
   203             cv.addAttribute(new ModuleHashesAttribute(hashes));
   206         if (moduleResolution != null)
   204         if (moduleResolution != null)
   207             cv.addAttribute(new ModuleResolutionAttribute(moduleResolution.value()));
   205             cv.addAttribute(new ModuleResolutionAttribute(moduleResolution.value()));
   208 
   206