| 1 | | | |
| 2 | | | |
| 3 | | | |
| 4 | | | |
| 5 | | | |
| 6 | | | |
| 7 | | | |
| 8 | | | |
| 9 | | | |
| 10 | | | |
| 11 | | | |
| 12 | | | |
| 13 | | | |
| 14 | | | |
| 15 | | | |
| 16 | | | |
| 17 | | | |
| 18 | | | |
| 19 | | | |
| 20 | | | |
| 21 | | | |
| 22 | | | |
| 23 | | | |
| 24 | | | |
| 25 | | | |
| 26 | | | |
| 27 | | | |
| 28 | | | |
| 29 | | | |
| 30 | | | |
| 31 | | | |
| 32 | | | |
| 33 | | | package org.jcoderz.commons.taskdefs; |
| 34 | | | |
| 35 | | | |
| 36 | | | import java.io.File; |
| 37 | | | import java.io.FileInputStream; |
| 38 | | | import java.io.FileOutputStream; |
| 39 | | | import java.io.FilenameFilter; |
| 40 | | | import java.io.IOException; |
| 41 | | | import java.io.OutputStream; |
| 42 | | | import java.util.ArrayList; |
| 43 | | | import java.util.Iterator; |
| 44 | | | import java.util.List; |
| 45 | | | |
| 46 | | | import javax.xml.transform.Transformer; |
| 47 | | | |
| 48 | | | import org.apache.batik.transcoder.TranscoderException; |
| 49 | | | import org.apache.batik.transcoder.TranscoderInput; |
| 50 | | | import org.apache.batik.transcoder.TranscoderOutput; |
| 51 | | | import org.apache.batik.transcoder.XMLAbstractTranscoder; |
| 52 | | | import org.apache.batik.transcoder.image.PNGTranscoder; |
| 53 | | | import org.apache.tools.ant.BuildException; |
| 54 | | | import org.apache.tools.ant.Project; |
| 55 | | | import org.apache.tools.ant.Task; |
| 56 | | | import org.apache.tools.ant.types.FileSet; |
| 57 | | | import org.apache.tools.ant.types.Path; |
| 58 | | | import org.jcoderz.commons.util.Constants; |
| 59 | | | import org.jcoderz.commons.util.IoUtil; |
| 60 | | | import org.jcoderz.commons.util.StringUtil; |
| 61 | | | |
| 62 | | | |
| 63 | | | |
| 64 | | | |
| 65 | | | |
| 66 | | | @author |
| 67 | | | |
| 68 | 0 | | public class XtremeDocs |
| 69 | | | extends Task |
| 70 | | | { |
| 71 | | | private static final String FORMAT_PDF = "PDF"; |
| 72 | | | |
| 73 | | | private static final String FORMAT_HTML = "HTML"; |
| 74 | | | |
| 75 | | | private static final String FORMAT_ALL = "ALL"; |
| 76 | | | |
| 77 | | | private static final String FORMAT_NONE = "NONE"; |
| 78 | | | |
| 79 | | | private static final String TYPE_QUALITY_REPORT = "Quality-Report"; |
| 80 | | | |
| 81 | | | private static final String TYPE_KPI_STATS = "KPI-Stats"; |
| 82 | | | |
| 83 | | | private static final String TYPE_KPI_REPORT = "KPI-Report"; |
| 84 | | | |
| 85 | | | private static final String TYPE_RELEASE_NOTES = "Release-Notes"; |
| 86 | | | |
| 87 | | | private static final String TYPE_TEST_SPEC = "TestSpec"; |
| 88 | | | |
| 89 | | | private static final String TYPE_USE_CASE = "UseCase"; |
| 90 | | | |
| 91 | | | private static final String TYPE_SAD = "SAD"; |
| 92 | | | |
| 93 | | | private static final String IMAGE_DIR = "images"; |
| 94 | | | |
| 95 | | | private static final String APIDOC_DIR = "apidoc"; |
| 96 | | | |
| 97 | | | private static final String DEFAULT_COMPANY_NAME = "jCoderZ.org"; |
| 98 | | | |
| 99 | | | private static final String DEFAULT_COMPANY_LOGO = "jcoderz-org"; |
| 100 | | | |
| 101 | | | private static final boolean DEFAULT_VALIDATION_ONLY_FLAG = false; |
| 102 | | | |
| 103 | | | |
| 104 | | | private File mOutDir; |
| 105 | | | |
| 106 | | | |
| 107 | | | private File mXepHome; |
| 108 | | | |
| 109 | | | |
| 110 | | | private File mInFile; |
| 111 | | | |
| 112 | | | |
| 113 | | | private boolean mFailOnError; |
| 114 | | | |
| 115 | | | |
| 116 | | | private String mType; |
| 117 | | | |
| 118 | | | |
| 119 | | | private String mFormat; |
| 120 | | | |
| 121 | | | private String mTypeLowerCase; |
| 122 | | | |
| 123 | 0 | | private final Path mDocletPath = new Path(getProject()); |
| 124 | | | |
| 125 | 0 | | private final Path mClassPath = new Path(getProject()); |
| 126 | | | |
| 127 | 0 | | private final List mFormatters = new ArrayList(); |
| 128 | | | |
| 129 | | | |
| 130 | 0 | | private final List mSources = new ArrayList(); |
| 131 | | | |
| 132 | | | |
| 133 | | | private String mCcLabel; |
| 134 | | | |
| 135 | | | |
| 136 | 0 | | private String mCompanyName = DEFAULT_COMPANY_NAME; |
| 137 | | | |
| 138 | | | |
| 139 | 0 | | private String mCompanyLogo = DEFAULT_COMPANY_LOGO; |
| 140 | | | |
| 141 | | | |
| 142 | 0 | | private boolean mValidationOnly = DEFAULT_VALIDATION_ONLY_FLAG; |
| 143 | | | |
| 144 | | | |
| 145 | 0 | | private final List mTransformerProperties = new ArrayList(); |
| 146 | | | |
| 147 | | | private HibernateInfoData mHibernateInfoData; |
| 148 | | | |
| 149 | | | |
| 150 | | | |
| 151 | | | |
| 152 | | | @param |
| 153 | | | |
| 154 | | | public void addParam (org.apache.tools.ant.types.Environment.Variable var) |
| 155 | | | { |
| 156 | 0 | | mTransformerProperties.add(var); |
| 157 | 0 | | } |
| 158 | | | |
| 159 | | | void setXdocTransformerParams (Transformer transformer) |
| 160 | | | { |
| 161 | | (1) | |
| 162 | | | |
| 163 | | | |
| 164 | 0 | | transformer.setParameter("basedir", getProject().getBaseDir() |
| 165 | | | .toString()); |
| 166 | 0 | | transformer.setParameter("cclabel", mCcLabel); |
| 167 | 0 | | transformer.setParameter("user", System.getProperty("user.name")); |
| 168 | 0 | | transformer.setParameter("companyname", mCompanyName); |
| 169 | 0 | | transformer.setParameter("companylogo", mCompanyLogo); |
| 170 | 0 | | final Iterator i = mTransformerProperties.iterator(); |
| 171 | 0 | | while (i.hasNext()) |
| 172 | | | { |
| 173 | 0 | (2) | final org.apache.tools.ant.types.Environment.Variable var = (org.apache.tools.ant.types.Environment.Variable) i |
| 174 | | | .next(); |
| 175 | 0 | | transformer.setParameter(var.getKey(), var.getValue()); |
| 176 | 0 | | } |
| 177 | 0 | | } |
| 178 | | | |
| 179 | | | |
| 180 | | | |
| 181 | | | |
| 182 | | | @param |
| 183 | | | |
| 184 | | | public void setIn (File f) |
| 185 | | | { |
| 186 | 0 | | mInFile = f; |
| 187 | 0 | | } |
| 188 | | | |
| 189 | | | |
| 190 | | | |
| 191 | | | |
| 192 | | | |
| 193 | | | @param |
| 194 | | | |
| 195 | | | public void setOut (File dir) |
| 196 | | | { |
| 197 | 0 | | mOutDir = dir; |
| 198 | 0 | | } |
| 199 | | | |
| 200 | | | |
| 201 | | | |
| 202 | | | |
| 203 | | | @param |
| 204 | | | |
| 205 | | | public void setXephome (File dir) |
| 206 | | | { |
| 207 | 0 | | mXepHome = dir; |
| 208 | 0 | | } |
| 209 | | | |
| 210 | | | |
| 211 | | | |
| 212 | | | |
| 213 | | | @param |
| 214 | | | |
| 215 | | | public void setType (String type) |
| 216 | | | { |
| 217 | 0 | | mType = type; |
| 218 | 0 | | mTypeLowerCase = type.toLowerCase(Constants.SYSTEM_LOCALE); |
| 219 | 0 | | } |
| 220 | | | |
| 221 | | | |
| 222 | | | |
| 223 | | | |
| 224 | | | @param |
| 225 | | | |
| 226 | | | public void setFormat (String format) |
| 227 | | | { |
| 228 | 0 | | mFormat = format; |
| 229 | 0 | | } |
| 230 | | | |
| 231 | | | |
| 232 | | | |
| 233 | | | |
| 234 | | | @param |
| 235 | | | |
| 236 | | | public void setCclabel (String label) |
| 237 | | | { |
| 238 | 0 | | mCcLabel = label; |
| 239 | 0 | | } |
| 240 | | | |
| 241 | | | |
| 242 | | | |
| 243 | | | |
| 244 | | | @param |
| 245 | | | |
| 246 | | | public void setCompanyName (String companyName) |
| 247 | | | { |
| 248 | 0 | | mCompanyName = companyName; |
| 249 | 0 | | } |
| 250 | | | |
| 251 | | | |
| 252 | | | |
| 253 | | | |
| 254 | | | @param |
| 255 | | | |
| 256 | | | public void setValidationOnly (boolean validationOnly) |
| 257 | | | { |
| 258 | 0 | | mValidationOnly = validationOnly; |
| 259 | 0 | | } |
| 260 | | | |
| 261 | | | |
| 262 | | | |
| 263 | | | |
| 264 | | | @param |
| 265 | | | |
| 266 | | | public void setCompanyLogo (String companyLogo) |
| 267 | | | { |
| 268 | 0 | | mCompanyLogo = companyLogo; |
| 269 | 0 | | } |
| 270 | | | |
| 271 | | | |
| 272 | | | |
| 273 | | | |
| 274 | | | @param |
| 275 | | | |
| 276 | | | public void setFailonerror (boolean b) |
| 277 | | | { |
| 278 | 0 | | mFailOnError = b; |
| 279 | 0 | | } |
| 280 | | | |
| 281 | | | |
| 282 | | | |
| 283 | | | |
| 284 | | | @return |
| 285 | | | |
| 286 | | | public Path createDocletpath () |
| 287 | | | { |
| 288 | 0 | | return mDocletPath; |
| 289 | | | } |
| 290 | | | |
| 291 | | | |
| 292 | | | |
| 293 | | | |
| 294 | | | |
| 295 | | | @return |
| 296 | | | |
| 297 | | | public Path createClasspath () |
| 298 | | | { |
| 299 | 0 | | return mClassPath; |
| 300 | | | } |
| 301 | | | |
| 302 | | | |
| 303 | | | |
| 304 | | | |
| 305 | | | |
| 306 | | | @return |
| 307 | | | |
| 308 | | | public FormatterInfoData createFormatter () |
| 309 | | | { |
| 310 | 0 | | final FormatterInfoData result = FormatterInfoData.create(); |
| 311 | 0 | | mFormatters.add(result); |
| 312 | 0 | | return result; |
| 313 | | | } |
| 314 | | | |
| 315 | | | |
| 316 | | | |
| 317 | | | |
| 318 | | | |
| 319 | | | @return |
| 320 | | | |
| 321 | | | public HibernateInfoData createHibernate () |
| 322 | | | { |
| 323 | 0 | | final HibernateInfoData hibernateInfoData = HibernateInfoData.create(); |
| 324 | 0 | | mHibernateInfoData = hibernateInfoData; |
| 325 | 0 | | return hibernateInfoData; |
| 326 | | | } |
| 327 | | | |
| 328 | | | |
| 329 | | | |
| 330 | | | |
| 331 | | | @return |
| 332 | | | |
| 333 | | | public Path getClassPath () |
| 334 | | | { |
| 335 | 0 | | return mClassPath; |
| 336 | | | } |
| 337 | | | |
| 338 | | | |
| 339 | | | <tt></tt> |
| 340 | | | <tt></tt> |
| 341 | | | |
| 342 | | | @return<tt></tt> |
| 343 | | | <tt></tt> |
| 344 | | | |
| 345 | | | public boolean failOnError () |
| 346 | | | { |
| 347 | 0 | | return mFailOnError; |
| 348 | | | } |
| 349 | | | |
| 350 | | | |
| 351 | | | |
| 352 | | | |
| 353 | | | @param |
| 354 | | | |
| 355 | | | |
| 356 | | | public void addSrc (SourceDirectory src) |
| 357 | | | { |
| 358 | 0 | | mSources.add(src); |
| 359 | 0 | | } |
| 360 | | | |
| 361 | | | |
| 362 | | | |
| 363 | | | |
| 364 | | | @throws |
| 365 | | | |
| 366 | | (3) | public void execute () |
| 367 | | | throws BuildException |
| 368 | | | { |
| 369 | | | try |
| 370 | | | { |
| 371 | 0 | | checkAttributes(); |
| 372 | 0 | | log("Generating documentation into directory " + mOutDir); |
| 373 | 0 | | final File imageDir = new File(mOutDir, IMAGE_DIR); |
| 374 | | | |
| 375 | 0 | | final File filePassOne = transformPassOne(mInFile); |
| 376 | 0 | | if (TYPE_SAD.equals(mType)) |
| 377 | | | { |
| 378 | 0 | | generateApiDocs(filePassOne); |
| 379 | 0 | | generateSadDiagrams(filePassOne); |
| 380 | | | } |
| 381 | 0 | | else if (TYPE_USE_CASE.equals(mType)) |
| 382 | | | { |
| 383 | 0 | | if (!mValidationOnly) |
| 384 | | | { |
| 385 | 0 | | generateUseCaseDiagrams(filePassOne, imageDir); |
| 386 | | | |
| 387 | 0 | | AntTaskUtil.renderDotFiles(this, imageDir, mFailOnError); |
| 388 | 0 | | exportToHbCfg(filePassOne); |
| 389 | 0 | | exportToHbm(filePassOne); |
| 390 | | | } |
| 391 | | | } |
| 392 | 0 | | else if (TYPE_KPI_STATS.equals(mType)) |
| 393 | | | { |
| 394 | 0 | | final File kpiFile = transformPassTwo(filePassOne); |
| 395 | 0 | (4) | File newFile = new File(AntTaskUtil.stripFileExtension(AntTaskUtil |
| 396 | | | .stripFileExtension(kpiFile.getAbsolutePath()))); |
| 397 | 0 | (5) | kpiFile.renameTo(newFile); |
| 398 | 0 | | } |
| 399 | 0 | | else if (TYPE_KPI_REPORT.equals(mType)) |
| 400 | | | { |
| 401 | 0 | | generateKeyPerformanceDiagrams(filePassOne, imageDir); |
| 402 | 0 | | AntTaskUtil.renderGnuplotFiles(this, imageDir, mFailOnError); |
| 403 | | | } |
| 404 | 0 | | else if (TYPE_TEST_SPEC.equals(mType)) |
| 405 | | | { |
| 406 | | | |
| 407 | | | } |
| 408 | 0 | | else if (TYPE_QUALITY_REPORT.equals(mType)) |
| 409 | | | { |
| 410 | | | |
| 411 | | | } |
| 412 | 0 | | else if (TYPE_RELEASE_NOTES.equals(mType)) |
| 413 | | | { |
| 414 | | | |
| 415 | | | } |
| 416 | | | else |
| 417 | | | { |
| 418 | 0 | | throw new RuntimeException("Unsupported type " + mType); |
| 419 | | | } |
| 420 | | | |
| 421 | 0 | | if (TYPE_KPI_STATS.equals(mType)) |
| 422 | | | { |
| 423 | | | |
| 424 | | | } |
| 425 | | | else |
| 426 | | | { |
| 427 | 0 | | if (!mValidationOnly) |
| 428 | | | { |
| 429 | 0 | | if (isOutputEnabled(FORMAT_HTML)) |
| 430 | | | { |
| 431 | 0 | | rasterizeSvgFiles(imageDir); |
| 432 | | | } |
| 433 | 0 | | if (isOutputEnabled(FORMAT_PDF)) |
| 434 | | | { |
| 435 | 0 | | scaleSvgImages(imageDir); |
| 436 | | | } |
| 437 | | | } |
| 438 | | | } |
| 439 | | | |
| 440 | 0 | | if (TYPE_TEST_SPEC.equals(mType)) |
| 441 | | | { |
| 442 | 0 | | renderDocbookFilesFromPassOne(filePassOne); |
| 443 | | | } |
| 444 | 0 | | else if (TYPE_KPI_STATS.equals(mType)) |
| 445 | | | { |
| 446 | | | |
| 447 | | | } |
| 448 | 0 | | else if (TYPE_KPI_REPORT.equals(mType)) |
| 449 | | | { |
| 450 | 0 | | final File docBookFile = transformPassTwo(filePassOne); |
| 451 | | (6) | |
| 452 | 0 | | AntTaskUtil.renderGnuplotFiles(this, imageDir, mFailOnError); |
| 453 | 0 | | renderDocBook(docBookFile, mInFile); |
| 454 | 0 | | } |
| 455 | | | else |
| 456 | | | { |
| 457 | 0 | | final File docBookFile = transformPassTwo(filePassOne); |
| 458 | 0 | | renderDocBook(docBookFile, mInFile); |
| 459 | | | } |
| 460 | | | } |
| 461 | 0 | | catch (BuildException e) |
| 462 | | | { |
| 463 | 0 | | if (mFailOnError) |
| 464 | | | { |
| 465 | 0 | | throw e; |
| 466 | | | } |
| 467 | 0 | | log(e.getMessage(), Project.MSG_ERR); |
| 468 | 0 | | } |
| 469 | 0 | | } |
| 470 | | | |
| 471 | | | private boolean isOutputEnabled (String format) |
| 472 | | | { |
| 473 | | | final boolean result; |
| 474 | 0 | (7) | if (StringUtil.isEmptyOrNull(mFormat) |
| 475 | | | || mFormat.equals(FORMAT_ALL) || mFormat.equals(format)) |
| 476 | | | { |
| 477 | 0 | | result = true; |
| 478 | | | } |
| 479 | 0 | (8) | else if (mFormat.equals(FORMAT_NONE)) |
| 480 | | | { |
| 481 | 0 | | result = false; |
| 482 | | | } |
| 483 | | | else |
| 484 | | | { |
| 485 | 0 | | result = true; |
| 486 | | | } |
| 487 | 0 | | return result; |
| 488 | | | } |
| 489 | | | |
| 490 | | | File getXepHome () |
| 491 | | | { |
| 492 | 0 | | return mXepHome; |
| 493 | | | } |
| 494 | | | |
| 495 | | | private void renderDocBook (File docBookFile, File inFile) |
| 496 | | | { |
| 497 | 0 | | for (final Iterator i = mFormatters.iterator(); i.hasNext();) |
| 498 | | | { |
| 499 | 0 | | final FormatterInfoData f = (FormatterInfoData) i.next(); |
| 500 | 0 | | final Formatter formatter = Formatter.getInstance(f); |
| 501 | 0 | | final File out = new File(docBookFile.getParentFile(), AntTaskUtil |
| 502 | | | .stripFileExtension(inFile.getName()) |
| 503 | | | + "." + formatter.getFileExtension()); |
| 504 | 0 | | if (isOutputEnabled(formatter.getInfoData().getType())) |
| 505 | | | { |
| 506 | 0 | | formatter.transform(this, docBookFile, out); |
| 507 | | | } |
| 508 | 0 | | } |
| 509 | 0 | | } |
| 510 | | | |
| 511 | | | private void renderDocbookFilesFromPassOne (File filePassOne) |
| 512 | | | { |
| 513 | 0 | | File docbookDir = new File(filePassOne.getParent()); |
| 514 | 0 | | transformPassTwo(filePassOne); |
| 515 | 0 | | log("Search files to render in directory: " + docbookDir.getParent()); |
| 516 | 0 | | final File[] docbookFiles = docbookDir.listFiles(new FilenameFilter() |
| 517 | 0 | (9) | { |
| 518 | | | public boolean accept (File dir, String name) |
| 519 | | | { |
| 520 | | | final boolean result; |
| 521 | 0 | | if (name.endsWith(".p2")) |
| 522 | | | { |
| 523 | 0 | | result = true; |
| 524 | | | } |
| 525 | | | else |
| 526 | | | { |
| 527 | 0 | | result = false; |
| 528 | | | } |
| 529 | 0 | | return result; |
| 530 | | | } |
| 531 | | | }); |
| 532 | 0 | | if (docbookFiles != null) |
| 533 | | | { |
| 534 | 0 | | for (int i = 0; i < docbookFiles.length; i++) |
| 535 | | | { |
| 536 | 0 | | final File docbookFile = docbookFiles[i]; |
| 537 | 0 | | final File passOneFile = new File(AntTaskUtil |
| 538 | | | .stripFileExtension(AntTaskUtil |
| 539 | | | .stripFileExtension(docbookFile.getName()))); |
| 540 | 0 | | renderDocBook(docbookFile, passOneFile); |
| 541 | 0 | | log("Will render file: " + docbookFile.getName(), |
| 542 | | | Project.MSG_VERBOSE); |
| 543 | | | } |
| 544 | | | } |
| 545 | | | else |
| 546 | | | { |
| 547 | 0 | | log("No .xml files found to render", Project.MSG_VERBOSE); |
| 548 | | | } |
| 549 | 0 | | } |
| 550 | | | |
| 551 | | | private File transformPassOne (File in) |
| 552 | | | { |
| 553 | 0 | | final XsltBasedTask task = new XsltBasedTask() |
| 554 | 0 | | { |
| 555 | | | String getDefaultStyleSheet () |
| 556 | | | { |
| 557 | 0 | | return mTypeLowerCase + "-pass-one.xsl"; |
| 558 | | | } |
| 559 | | | |
| 560 | | | void setAdditionalTransformerParameters (Transformer transformer) |
| 561 | | | { |
| 562 | 0 | | setXdocTransformerParams(transformer); |
| 563 | 0 | | } |
| 564 | | | }; |
| 565 | 0 | | task.setProject(getProject()); |
| 566 | 0 | | task.setTaskName(mTypeLowerCase + "-p1"); |
| 567 | 0 | | task.setIn(in); |
| 568 | 0 | (10) | task.setForce(true); |
| 569 | 0 | | final File outFile = new File(mOutDir, in.getName() + ".p1"); |
| 570 | 0 | | task.setOut(outFile); |
| 571 | 0 | | task.setFailonerror(mFailOnError); |
| 572 | 0 | | task.setDestdir(outFile.getParentFile()); |
| 573 | 0 | | task.execute(); |
| 574 | 0 | | return outFile; |
| 575 | | | } |
| 576 | | | |
| 577 | | | private File transformPassTwo (File filePassOne) |
| 578 | | | { |
| 579 | 0 | | final XsltBasedTask task = new XsltBasedTask() |
| 580 | 0 | | { |
| 581 | | | String getDefaultStyleSheet () |
| 582 | | | { |
| 583 | 0 | | return mTypeLowerCase + "-pass-two.xsl"; |
| 584 | | | } |
| 585 | | | |
| 586 | | | void setAdditionalTransformerParameters (Transformer transformer) |
| 587 | | | { |
| 588 | 0 | | setXdocTransformerParams(transformer); |
| 589 | 0 | | } |
| 590 | | | }; |
| 591 | 0 | | task.setProject(getProject()); |
| 592 | 0 | | task.setTaskName(mTypeLowerCase + "-p2"); |
| 593 | 0 | | task.setIn(filePassOne); |
| 594 | 0 | (11) | task.setForce(true); |
| 595 | 0 | | final File outFile = new File(mOutDir, filePassOne.getName() + ".p2"); |
| 596 | 0 | | task.setOut(outFile); |
| 597 | 0 | | task.setFailonerror(mFailOnError); |
| 598 | 0 | | task.setDestdir(outFile.getParentFile()); |
| 599 | 0 | | task.execute(); |
| 600 | 0 | | return outFile; |
| 601 | | | } |
| 602 | | | |
| 603 | | | private void generateUseCaseDiagrams (File filePassOne, final File imageDir) |
| 604 | | | { |
| 605 | 0 | | if (isOutputEnabled(FORMAT_PDF) || isOutputEnabled(FORMAT_HTML)) |
| 606 | | | { |
| 607 | 0 | | final XsltBasedTask task = new XsltBasedTask() |
| 608 | 0 | (12) | { |
| 609 | | | String getDefaultStyleSheet () |
| 610 | | | { |
| 611 | 0 | | return "usecase_diagrams.xsl"; |
| 612 | | | } |
| 613 | | | |
| 614 | | | void setAdditionalTransformerParameters ( |
| 615 | | | Transformer transformer) |
| 616 | | | { |
| 617 | 0 | | transformer.setParameter( |
| 618 | | | "basedir", getProject().getBaseDir().toString()); |
| 619 | 0 | | transformer.setParameter("imagedir", imageDir.toString()); |
| 620 | 0 | | } |
| 621 | | | }; |
| 622 | 0 | | task.setProject(getProject()); |
| 623 | 0 | | task.setTaskName("diagrams"); |
| 624 | 0 | | task.setIn(filePassOne); |
| 625 | 0 | (13) | task.setForce(true); |
| 626 | 0 | | final File outFile |
| 627 | | (14) | = new File(mOutDir, "use-case-diagrams" + ".tmp"); |
| 628 | 0 | | task.setOut(outFile); |
| 629 | 0 | | task.setFailonerror(mFailOnError); |
| 630 | 0 | | task.setDestdir(outFile.getParentFile()); |
| 631 | 0 | | task.execute(); |
| 632 | | | } |
| 633 | 0 | | } |
| 634 | | | |
| 635 | | | private void generateKeyPerformanceDiagrams ( |
| 636 | | | File filePassOne, final File imageDir) |
| 637 | | | { |
| 638 | 0 | | if (isOutputEnabled(FORMAT_PDF) || isOutputEnabled(FORMAT_HTML)) |
| 639 | | | { |
| 640 | 0 | | final XsltBasedTask task = new XsltBasedTask() |
| 641 | 0 | | { |
| 642 | | | String getDefaultStyleSheet () |
| 643 | | | { |
| 644 | 0 | | return "key-performance-diagrams.xsl"; |
| 645 | | | } |
| 646 | | | |
| 647 | | | void setAdditionalTransformerParameters ( |
| 648 | | | Transformer transformer) |
| 649 | | | { |
| 650 | 0 | | setXdocTransformerParams(transformer); |
| 651 | 0 | | transformer.setParameter("imagedir", imageDir.toString()); |
| 652 | 0 | | } |
| 653 | | | }; |
| 654 | 0 | | task.setProject(getProject()); |
| 655 | 0 | | task.setTaskName("diagrams"); |
| 656 | 0 | | task.setIn(filePassOne); |
| 657 | 0 | (15) | task.setForce(true); |
| 658 | 0 | | final File outFile |
| 659 | | | = new File(mOutDir, "key-performance-diagrams" + ".tmp"); |
| 660 | 0 | | task.setOut(outFile); |
| 661 | 0 | | task.setFailonerror(mFailOnError); |
| 662 | 0 | | task.setDestdir(outFile.getParentFile()); |
| 663 | 0 | | task.execute(); |
| 664 | | | } |
| 665 | 0 | | } |
| 666 | | | |
| 667 | | (16) | private void exportToXmi (File filePassOne, final File imageDir) |
| 668 | | | { |
| 669 | 0 | | final XsltBasedTask task = new XsltBasedTask() |
| 670 | 0 | (17) | { |
| 671 | | | String getDefaultStyleSheet () |
| 672 | | | { |
| 673 | 0 | | return "usecase_xmi_export.xsl"; |
| 674 | | | } |
| 675 | | | |
| 676 | | | void setAdditionalTransformerParameters (Transformer transformer) |
| 677 | | | { |
| 678 | 0 | | transformer.setParameter("basedir", getProject().getBaseDir() |
| 679 | | | .toString()); |
| 680 | 0 | | transformer.setParameter("imagedir", imageDir.toString()); |
| 681 | 0 | | } |
| 682 | | | }; |
| 683 | 0 | | task.setProject(getProject()); |
| 684 | 0 | | task.setTaskName("uc-xmi"); |
| 685 | 0 | | task.setIn(filePassOne); |
| 686 | 0 | (18) | task.setForce(true); |
| 687 | 0 | | final File outFile = new File(mOutDir, "use-case-xmi" + ".tmp"); |
| 688 | 0 | | task.setOut(outFile); |
| 689 | 0 | | task.setFailonerror(mFailOnError); |
| 690 | 0 | | task.setDestdir(outFile.getParentFile()); |
| 691 | 0 | | task.execute(); |
| 692 | 0 | | } |
| 693 | | | |
| 694 | | | private void exportToHbm (File filePassOne) |
| 695 | | | { |
| 696 | 0 | | final String targetdir = buildTargetDir(filePassOne.getName()); |
| 697 | 0 | | File dir = new File(targetdir); |
| 698 | 0 | (19) | dir.mkdir(); |
| 699 | | | |
| 700 | 0 | | final XsltBasedTask task = new XsltBasedTask() |
| 701 | 0 | | { |
| 702 | | | String getDefaultStyleSheet () |
| 703 | | | { |
| 704 | 0 | | return "usecase_hbm_export.xsl"; |
| 705 | | | } |
| 706 | | | |
| 707 | | | void setAdditionalTransformerParameters (Transformer transformer) |
| 708 | | | { |
| 709 | 0 | | transformer.setParameter("targetdir", targetdir); |
| 710 | 0 | | transformer.setParameter("package-prefix", |
| 711 | | | mHibernateInfoData.getPackagePrefix()); |
| 712 | 0 | | transformer.setParameter("package-suffix", |
| 713 | | | mHibernateInfoData.getPackageSuffix()); |
| 714 | 0 | | transformer.setParameter("tablename-prefix", |
| 715 | | | mHibernateInfoData.getTableNamePrefix()); |
| 716 | 0 | | transformer.setParameter("tablename-suffix", |
| 717 | | | mHibernateInfoData.getTableNameSuffix()); |
| 718 | 0 | | transformer.setParameter("foreign-key-prefix", |
| 719 | | | mHibernateInfoData.getForeignKeyPrefix()); |
| 720 | 0 | | transformer.setParameter("foreign-key-suffix", |
| 721 | | | mHibernateInfoData.getForeignKeySuffix()); |
| 722 | 0 | | } |
| 723 | | | }; |
| 724 | 0 | | task.setProject(getProject()); |
| 725 | 0 | | task.setTaskName("uc-hbm"); |
| 726 | 0 | | task.setIn(filePassOne); |
| 727 | 0 | (20) | task.setForce(true); |
| 728 | 0 | | final File outFile = new File(mOutDir, "use-case-hbm" + ".tmp"); |
| 729 | 0 | | task.setOut(outFile); |
| 730 | 0 | | task.setFailonerror(mFailOnError); |
| 731 | 0 | | task.setDestdir(outFile.getParentFile()); |
| 732 | 0 | | task.execute(); |
| 733 | 0 | | } |
| 734 | | | |
| 735 | | | private void exportToHbCfg (File filePassOne) |
| 736 | | | { |
| 737 | 0 | | final String targetdir = buildTargetDir(filePassOne.getName()); |
| 738 | 0 | | File dir = new File(targetdir); |
| 739 | 0 | (21) | dir.mkdir(); |
| 740 | | | |
| 741 | 0 | | final XsltBasedTask task = new XsltBasedTask() |
| 742 | 0 | | { |
| 743 | | | String getDefaultStyleSheet () |
| 744 | | | { |
| 745 | 0 | | return "usecase_hbcfg_export.xsl"; |
| 746 | | | } |
| 747 | | | |
| 748 | | | void setAdditionalTransformerParameters (Transformer transformer) |
| 749 | | | { |
| 750 | 0 | | transformer.setParameter("targetdir", targetdir); |
| 751 | 0 | | transformer.setParameter("session-factory", |
| 752 | | | mHibernateInfoData.getSessionFactory()); |
| 753 | 0 | | } |
| 754 | | | }; |
| 755 | 0 | | task.setProject(getProject()); |
| 756 | 0 | | task.setTaskName("uc-hbm"); |
| 757 | 0 | | task.setIn(filePassOne); |
| 758 | 0 | (22) | task.setForce(true); |
| 759 | 0 | | final File outFile = new File(mOutDir, "use-case-hbcfg" + ".tmp"); |
| 760 | 0 | | task.setOut(outFile); |
| 761 | 0 | | task.setFailonerror(mFailOnError); |
| 762 | 0 | | task.setDestdir(outFile.getParentFile()); |
| 763 | 0 | | task.execute(); |
| 764 | 0 | | } |
| 765 | | | |
| 766 | | | private String buildTargetDir (String name) |
| 767 | | | { |
| 768 | 0 | | String strippedName = name.substring(0, name.lastIndexOf(".xml.p1")); |
| 769 | 0 | | String dir = mOutDir + File.separator + strippedName |
| 770 | | | + File.separator + "hibernate"; |
| 771 | 0 | (23) | return dir; |
| 772 | | | } |
| 773 | | | |
| 774 | | | private void generateSadDiagrams (File in) |
| 775 | | | { |
| 776 | 0 | | final DiagramTask task = new DiagramTask(); |
| 777 | 0 | | task.setTaskName(DiagramTask.NAME); |
| 778 | 0 | | task.setProject(getProject()); |
| 779 | 0 | | task.setIn(in); |
| 780 | 0 | | for (final Iterator i = mSources.iterator(); i.hasNext();) |
| 781 | | | { |
| 782 | 0 | | final SourceDirectory src = (SourceDirectory) i.next(); |
| 783 | 0 | | task.addSrc(src); |
| 784 | 0 | | } |
| 785 | 0 | | task.setFailonerror(mFailOnError); |
| 786 | 0 | | final File out = new File(mOutDir, IMAGE_DIR); |
| 787 | 0 | | task.setOut(out); |
| 788 | 0 | | task.setDocletPath(mDocletPath); |
| 789 | 0 | | task.execute(); |
| 790 | 0 | | } |
| 791 | | | |
| 792 | | | private void scaleSvgImages (File dir) |
| 793 | | | { |
| 794 | 0 | | final XsltBatchProcessor x = new XsltBatchProcessor(); |
| 795 | 0 | | x.setProject(getProject()); |
| 796 | 0 | | x.setTaskName("svg-scale"); |
| 797 | 0 | | x.setFailonerror(mFailOnError); |
| 798 | 0 | | x.setXsl("svg-image-transform.xsl"); |
| 799 | 0 | | x.resolveExternalEntities(false); |
| 800 | 0 | | final FileSet fs = new FileSet(); |
| 801 | 0 | | fs.setDir(dir); |
| 802 | 0 | | fs.setIncludes("*.svg"); |
| 803 | 0 | | x.addFiles(fs); |
| 804 | 0 | | x.execute(); |
| 805 | 0 | | } |
| 806 | | | |
| 807 | | | private void generateApiDocs (File in) |
| 808 | | | { |
| 809 | 0 | | final ApiDocTask task = new ApiDocTask(); |
| 810 | 0 | | task.setTaskName(ApiDocTask.NAME); |
| 811 | 0 | | task.setProject(getProject()); |
| 812 | 0 | | task.setIn(in); |
| 813 | 0 | | for (final Iterator i = mSources.iterator(); i.hasNext();) |
| 814 | | | { |
| 815 | 0 | | final SourceDirectory src = (SourceDirectory) i.next(); |
| 816 | 0 | | task.addSrc(src); |
| 817 | 0 | | } |
| 818 | 0 | | task.setFailonerror(mFailOnError); |
| 819 | 0 | | final File out = new File(mOutDir, APIDOC_DIR); |
| 820 | 0 | (24) | out.mkdirs(); |
| 821 | 0 | | task.setOut(out); |
| 822 | 0 | | task.setDocletPath(mDocletPath); |
| 823 | 0 | | task.execute(); |
| 824 | | | |
| 825 | 0 | | final XsltBatchProcessor x = new XsltBatchProcessor(); |
| 826 | 0 | | x.setProject(getProject()); |
| 827 | 0 | | x.setTaskName("java2docbook"); |
| 828 | 0 | | x.setFailonerror(mFailOnError); |
| 829 | 0 | | x.setXsl("java2docbook.xsl"); |
| 830 | 0 | | final FileSet fs = new FileSet(); |
| 831 | 0 | | fs.setDir(out); |
| 832 | 0 | | fs.setIncludes("*.xml"); |
| 833 | 0 | | x.addFiles(fs); |
| 834 | 0 | | x.execute(); |
| 835 | 0 | | } |
| 836 | | | |
| 837 | | | |
| 838 | | | |
| 839 | | | |
| 840 | | | @throws |
| 841 | | | |
| 842 | | | private void checkAttributes () |
| 843 | | | throws BuildException |
| 844 | | | { |
| 845 | 0 | | checkAttributeInFile(); |
| 846 | 0 | | XsltBasedTask.checkXercesVersion(this); |
| 847 | 0 | | } |
| 848 | | | |
| 849 | | | private void checkAttributeInFile () |
| 850 | | | { |
| 851 | 0 | | if (mInFile == null) |
| 852 | | | { |
| 853 | 0 | | throw new BuildException("Missing mandatory attribute 'in'.", |
| 854 | | | getLocation()); |
| 855 | | | } |
| 856 | 0 | | if (!mInFile.exists()) |
| 857 | | | { |
| 858 | 0 | | throw new BuildException("Input file '" + mInFile + "' not found.", |
| 859 | | | getLocation()); |
| 860 | | | } |
| 861 | 0 | | } |
| 862 | | | |
| 863 | | | private void rasterizeSvgFiles (File directory) |
| 864 | | | { |
| 865 | 0 | | final File[] svgFiles = directory.listFiles(new FilenameFilter() |
| 866 | 0 | (25) | { |
| 867 | | | public boolean accept (File dir, String name) |
| 868 | | | { |
| 869 | | | final boolean result; |
| 870 | 0 | | if (name.endsWith(".svg")) |
| 871 | | | { |
| 872 | 0 | | result = true; |
| 873 | | | } |
| 874 | | | else |
| 875 | | | { |
| 876 | 0 | | result = false; |
| 877 | | | } |
| 878 | 0 | | return result; |
| 879 | | | } |
| 880 | | | }); |
| 881 | 0 | | log("Creating raster images for " + svgFiles.length |
| 882 | | | + " images", Project.MSG_INFO); |
| 883 | 0 | | for (int i = 0; i < svgFiles.length; i++) |
| 884 | | | { |
| 885 | 0 | | final File svgFile = svgFiles[i]; |
| 886 | | | try |
| 887 | | | { |
| 888 | 0 | | log("Creating raster image for '" + svgFile.getCanonicalPath() |
| 889 | | | + "'", Project.MSG_VERBOSE); |
| 890 | | | |
| 891 | | | |
| 892 | | | |
| 893 | | | |
| 894 | | | |
| 895 | | | |
| 896 | 0 | | final File pngFile = new File(svgFile.getParentFile(), svgFile |
| 897 | | | .getName().substring(0, svgFile.getName().indexOf('.')) |
| 898 | | | + ".png"); |
| 899 | 0 | | Rasterizer.rasterize(svgFile, pngFile); |
| 900 | | | } |
| 901 | 0 | | catch (Exception ex) |
| 902 | | | { |
| 903 | 0 | | throw new BuildException( |
| 904 | | | "Could not generate raster image for '" + svgFile.getName() |
| 905 | | | + "' (" + ex + ")"); |
| 906 | 0 | | } |
| 907 | | | } |
| 908 | 0 | | } |
| 909 | | | |
| 910 | | | private static final class Rasterizer |
| 911 | | | { |
| 912 | | | private static final PNGTranscoder TRANSCODER; |
| 913 | | | static |
| 914 | | | { |
| 915 | 0 | | TRANSCODER = new PNGTranscoder(); |
| 916 | | | |
| 917 | 0 | | TRANSCODER.addTranscodingHint( |
| 918 | | | XMLAbstractTranscoder.KEY_XML_PARSER_CLASSNAME, |
| 919 | | | "org.apache.xerces.parsers.SAXParser"); |
| 920 | 0 | | } |
| 921 | | | |
| 922 | | | private Rasterizer () |
| 923 | 0 | | { |
| 924 | | | |
| 925 | 0 | | } |
| 926 | | | |
| 927 | | | public static void rasterize (File in, File out) |
| 928 | | | throws TranscoderException, IOException |
| 929 | | | { |
| 930 | 0 | | final OutputStream ostream = new FileOutputStream(out); |
| 931 | | | try |
| 932 | | | { |
| 933 | | | |
| 934 | 0 | | final TranscoderInput input = new TranscoderInput( |
| 935 | | | new FileInputStream(in)); |
| 936 | 0 | (26) | input.setURI(in.toURL().toExternalForm()); |
| 937 | | | |
| 938 | 0 | | final TranscoderOutput output = new TranscoderOutput(ostream); |
| 939 | | | |
| 940 | 0 | | TRANSCODER.transcode(input, output); |
| 941 | 0 | | ostream.flush(); |
| 942 | | | } |
| 943 | | | finally |
| 944 | | | { |
| 945 | 0 | | IoUtil.close(ostream); |
| 946 | 0 | | } |
| 947 | 0 | | } |
| 948 | | | } |
| 949 | | | |
| 950 | | | |
| 951 | | | |
| 952 | | | |
| 953 | 0 | | public static class FormatterInfoData |
| 954 | | | { |
| 955 | | | private File mStyleSheet; |
| 956 | | | |
| 957 | | | private File mCascadingStyleSheet; |
| 958 | | | |
| 959 | | | private String mType; |
| 960 | | | |
| 961 | | | |
| 962 | | | |
| 963 | | | |
| 964 | | | @return |
| 965 | | | |
| 966 | | | public File getCascadingStyleSheet () |
| 967 | | | { |
| 968 | 0 | | return mCascadingStyleSheet; |
| 969 | | | } |
| 970 | | | |
| 971 | | | |
| 972 | | | |
| 973 | | | |
| 974 | | | @param |
| 975 | | | |
| 976 | | | public void setCss (File cascadingStyleSheet) |
| 977 | | | { |
| 978 | 0 | | mCascadingStyleSheet = cascadingStyleSheet; |
| 979 | 0 | | } |
| 980 | | | |
| 981 | | | |
| 982 | | | |
| 983 | | | |
| 984 | | | @return |
| 985 | | | |
| 986 | | | public File getStyleSheet () |
| 987 | | | { |
| 988 | 0 | | return mStyleSheet; |
| 989 | | | } |
| 990 | | | |
| 991 | | | |
| 992 | | | |
| 993 | | | |
| 994 | | | @param |
| 995 | | | |
| 996 | | | public void setStyle (File styleSheet) |
| 997 | | | { |
| 998 | 0 | | mStyleSheet = styleSheet; |
| 999 | 0 | | } |
| 1000 | | | |
| 1001 | | | |
| 1002 | | | |
| 1003 | | | |
| 1004 | | | @return |
| 1005 | | | |
| 1006 | | | public String getType () |
| 1007 | | | { |
| 1008 | 0 | | return mType; |
| 1009 | | | } |
| 1010 | | | |
| 1011 | | | |
| 1012 | | | |
| 1013 | | | |
| 1014 | | | @param |
| 1015 | | | |
| 1016 | | | public void setType (String type) |
| 1017 | | | { |
| 1018 | 0 | | mType = type; |
| 1019 | 0 | | } |
| 1020 | | | |
| 1021 | | | |
| 1022 | | | |
| 1023 | | | |
| 1024 | | | @return |
| 1025 | | | |
| 1026 | | | public static FormatterInfoData create () |
| 1027 | | | { |
| 1028 | 0 | | return new FormatterInfoData(); |
| 1029 | | | } |
| 1030 | | | } |
| 1031 | | | |
| 1032 | | | |
| 1033 | | | |
| 1034 | | | |
| 1035 | 0 | | public static class HibernateInfoData |
| 1036 | | | { |
| 1037 | | | private static final String DEFAULT_PACKAGE_PREFIX |
| 1038 | | | = "org.jcoderz.hibernate"; |
| 1039 | | | private static final String DEFAULT_PACKAGE_SUFFIX = ""; |
| 1040 | | | |
| 1041 | | | private static final String DEFAULT_TABLE_NAME_PREFIX = "JC_"; |
| 1042 | | | private static final String DEFAULT_TABLE_NAME_SUFFIX = "S"; |
| 1043 | | | |
| 1044 | | | private static final String DEFAULT_FOREIGN_KEY_PREFIX = "FK_"; |
| 1045 | | | private static final String DEFAULT_FOREIGN_KEY_SUFFIX = ""; |
| 1046 | | | |
| 1047 | | | private static final String DEFAULT_HIBERNATE_SESSION_FACTORY |
| 1048 | | | = "Default"; |
| 1049 | | | |
| 1050 | | | |
| 1051 | 0 | | private String mPackagePrefix = DEFAULT_PACKAGE_PREFIX; |
| 1052 | | | |
| 1053 | | | |
| 1054 | 0 | | private String mPackageSuffix = DEFAULT_PACKAGE_SUFFIX; |
| 1055 | | | |
| 1056 | | | |
| 1057 | 0 | | private String mTableNamePrefix = DEFAULT_TABLE_NAME_PREFIX; |
| 1058 | | | |
| 1059 | | | |
| 1060 | 0 | | private String mTableNameSuffix = DEFAULT_TABLE_NAME_SUFFIX; |
| 1061 | | | |
| 1062 | | | |
| 1063 | 0 | | private String mForeignKeyPrefix = DEFAULT_FOREIGN_KEY_PREFIX; |
| 1064 | | | |
| 1065 | | | |
| 1066 | 0 | | private String mForeignKeySuffix = DEFAULT_FOREIGN_KEY_SUFFIX; |
| 1067 | | | |
| 1068 | | | |
| 1069 | 0 | (27) | private String mHibernateSessionFactory = DEFAULT_HIBERNATE_SESSION_FACTORY; |
| 1070 | | | |
| 1071 | | | |
| 1072 | | | |
| 1073 | | | |
| 1074 | | | @return |
| 1075 | | | |
| 1076 | | | public static HibernateInfoData create () |
| 1077 | | | { |
| 1078 | 0 | | return new HibernateInfoData(); |
| 1079 | | | } |
| 1080 | | | |
| 1081 | | | |
| 1082 | | | |
| 1083 | | | |
| 1084 | | | @param |
| 1085 | | | |
| 1086 | | | public void setSessionFactory ( |
| 1087 | | | String hibernateSessionFactory) |
| 1088 | | | { |
| 1089 | 0 | | this.mHibernateSessionFactory = hibernateSessionFactory; |
| 1090 | 0 | | } |
| 1091 | | | |
| 1092 | | | |
| 1093 | | | |
| 1094 | | | |
| 1095 | | | @return |
| 1096 | | | |
| 1097 | | | public String getSessionFactory () |
| 1098 | | | { |
| 1099 | 0 | | return mHibernateSessionFactory; |
| 1100 | | | } |
| 1101 | | | |
| 1102 | | | |
| 1103 | | | |
| 1104 | | | |
| 1105 | | | @param |
| 1106 | | | |
| 1107 | | | public void setPackagePrefix (String packagePrefix) |
| 1108 | | | { |
| 1109 | 0 | | mPackagePrefix = packagePrefix; |
| 1110 | 0 | | } |
| 1111 | | | |
| 1112 | | | |
| 1113 | | | |
| 1114 | | | |
| 1115 | | | @return |
| 1116 | | | |
| 1117 | | | public String getPackagePrefix () |
| 1118 | | | { |
| 1119 | 0 | | return mPackagePrefix; |
| 1120 | | | } |
| 1121 | | | |
| 1122 | | | |
| 1123 | | | |
| 1124 | | | |
| 1125 | | | @param |
| 1126 | | | |
| 1127 | | | public void setPackageSuffix (String packageSuffix) |
| 1128 | | | { |
| 1129 | 0 | | mPackageSuffix = packageSuffix; |
| 1130 | 0 | | } |
| 1131 | | | |
| 1132 | | | |
| 1133 | | | |
| 1134 | | | |
| 1135 | | | @return |
| 1136 | | | |
| 1137 | | | public String getPackageSuffix () |
| 1138 | | | { |
| 1139 | 0 | | return mPackageSuffix; |
| 1140 | | | } |
| 1141 | | | |
| 1142 | | | |
| 1143 | | | |
| 1144 | | | |
| 1145 | | | @param |
| 1146 | | | |
| 1147 | | (28) | public void setTableNamePrefix (String tableNamePrefix) |
| 1148 | | | { |
| 1149 | 0 | | mTableNamePrefix = tableNamePrefix; |
| 1150 | 0 | | } |
| 1151 | | | |
| 1152 | | | |
| 1153 | | | |
| 1154 | | | |
| 1155 | | | @return |
| 1156 | | | |
| 1157 | | | public String getTableNamePrefix () |
| 1158 | | | { |
| 1159 | 0 | | return mTableNamePrefix; |
| 1160 | | | } |
| 1161 | | | |
| 1162 | | | |
| 1163 | | | |
| 1164 | | | |
| 1165 | | | @param |
| 1166 | | | |
| 1167 | | (29) | public void setTableNameSuffix (String tableNameSuffix) |
| 1168 | | | { |
| 1169 | 0 | | mTableNameSuffix = tableNameSuffix; |
| 1170 | 0 | | } |
| 1171 | | | |
| 1172 | | | |
| 1173 | | | |
| 1174 | | | |
| 1175 | | | @return |
| 1176 | | | |
| 1177 | | | public String getTableNameSuffix () |
| 1178 | | | { |
| 1179 | 0 | | return mTableNameSuffix; |
| 1180 | | | } |
| 1181 | | | |
| 1182 | | | |
| 1183 | | | |
| 1184 | | | |
| 1185 | | | @param |
| 1186 | | | |
| 1187 | | (30) | public void setForeignKeyPrefix (String foreignKeyPrefix) |
| 1188 | | | { |
| 1189 | 0 | | mForeignKeyPrefix = foreignKeyPrefix; |
| 1190 | 0 | | } |
| 1191 | | | |
| 1192 | | | |
| 1193 | | | |
| 1194 | | | |
| 1195 | | | @return |
| 1196 | | | |
| 1197 | | | public String getForeignKeyPrefix () |
| 1198 | | | { |
| 1199 | 0 | | return mForeignKeyPrefix; |
| 1200 | | | } |
| 1201 | | | |
| 1202 | | | |
| 1203 | | | |
| 1204 | | | |
| 1205 | | | @param |
| 1206 | | | |
| 1207 | | (31) | public void setForeignKeySuffix (String foreignKeySuffix) |
| 1208 | | | { |
| 1209 | 0 | | mForeignKeySuffix = foreignKeySuffix; |
| 1210 | 0 | | } |
| 1211 | | | |
| 1212 | | | public String getForeignKeySuffix () |
| 1213 | | | { |
| 1214 | 0 | | return mForeignKeySuffix; |
| 1215 | | | } |
| 1216 | | | |
| 1217 | | | } |
| 1218 | | | |
| 1219 | | | } |