1 42 43 package org.jfree.base; 44 45 import java.util.ArrayList ; 46 47 53 public class BootableProjectInfo extends BasicProjectInfo { 54 55 56 private String bootClass; 57 58 59 private boolean autoBoot; 60 61 64 public BootableProjectInfo() { 65 this.autoBoot = true; 66 } 67 68 76 public BootableProjectInfo(final String name, final String version, 77 final String licence, final String info) { 78 this(); 79 setName(name); 80 setVersion(version); 81 setLicenceName(licence); 82 setInfo(info); 83 } 84 85 94 public BootableProjectInfo(final String name, final String version, final String info, 95 final String copyright, final String licenceName) { 96 this(); 97 setName(name); 98 setVersion(version); 99 setLicenceName(licenceName); 100 setInfo(info); 101 setCopyright(copyright); 102 } 103 104 109 public BootableProjectInfo[] getDependencies() { 110 final ArrayList dependencies = new ArrayList (); 111 final Library[] libraries = getLibraries(); 112 for (int i = 0; i < libraries.length; i++) { 113 Library lib = libraries[i]; 114 if (lib instanceof BootableProjectInfo) { 115 dependencies.add(lib); 116 } 117 } 118 119 final Library[] optionalLibraries = getOptionalLibraries(); 120 for (int i = 0; i < optionalLibraries.length; i++) { 121 Library lib = optionalLibraries[i]; 122 if (lib instanceof BootableProjectInfo) { 123 dependencies.add(lib); 124 } 125 } 126 return (BootableProjectInfo[]) dependencies.toArray 127 (new BootableProjectInfo[dependencies.size()]); 128 } 129 130 136 public void addDependency(final BootableProjectInfo projectInfo) { 137 if (projectInfo == null) { 138 throw new NullPointerException (); 139 } 140 addLibrary(projectInfo); 141 } 142 143 148 public String getBootClass() { 149 return this.bootClass; 150 } 151 152 157 public void setBootClass(final String bootClass) { 158 this.bootClass = bootClass; 159 } 160 161 166 public boolean isAutoBoot() { 167 return this.autoBoot; 168 } 169 170 175 public void setAutoBoot(final boolean autoBoot) { 176 this.autoBoot = autoBoot; 177 } 178 179 } 180 | Popular Tags |