Esempio n. 1
0
 private String getQualifiedName(String uri, String name) {
   Namespace sdoNamespace = PlasmaConfig.getInstance().getSDONamespaceByURI(uri);
   String packageName = sdoNamespace.getProvisioning().getPackageName();
   String subpackage =
       PlasmaConfig.getInstance()
           .getSDO()
           .getGlobalProvisioning()
           .getQueryDSL()
           .getImplementation()
           .getChildPackageName();
   if (subpackage != null && subpackage.trim().length() > 0)
     packageName = packageName + "." + subpackage;
   String className = PlasmaConfig.getInstance().getQueryDSLImplementationClassName(uri, name);
   className = this.replaceReservedCharacters(className);
   String qualifiedName = packageName + "." + className;
   return qualifiedName;
 }
Esempio n. 2
0
  private String createTypeDeclarationJavadoc(Package pkg, Class clss) {
    TextBuilder buf = new TextBuilder(LINE_SEP, this.context.getIndentationToken());

    buf.append("/**"); // begin javadoc

    // add formatted doc from UML if exists
    // always put model definition first so it appears
    // on package summary line for class
    String docs = getWrappedDocmentations(clss.getDocumentations(), 0);
    if (docs.trim().length() > 0) {
      buf.append(docs);

      // if we have model docs, set up the next section w/a "header"
      buf.append(newline(0));
      buf.append(" * <p></p>");
    }

    buf.append(newline(0));
    buf.append(" * Generated interface representing the domain model entity <b>");
    buf.append(clss.getName());
    buf.append(
        "</b>. This <a href=\"http://plasma-sdo.org\">SDO</a> interface directly reflects the");
    buf.append(newline(0));
    buf.append(" * class (single or multiple) inheritance lattice of the source domain model(s) ");
    buf.append(" and is part of namespace <b>");
    buf.append(clss.getUri());
    buf.append(
        "</b> defined within the <a href=\"http://docs.plasma-sdo.org/api/org/plasma/config/package-summary.html\">Configuration</a>.");

    // data store mapping
    if (clss.getAlias() != null && clss.getAlias().getPhysicalName() != null) {
      buf.append(newline(0));
      buf.append(" *");
      buf.append(newline(0));
      buf.append(" * <p></p>");
      buf.append(newline(0));
      buf.append(" * <b>Data Store Mapping:</b>");
      buf.append(newline(0));
      buf.append(" * Corresponds to the physical data store entity <b>");
      buf.append(clss.getAlias().getPhysicalName());
      buf.append("</b>.");
      buf.append(newline(0));
      buf.append(" * <p></p>");
      buf.append(newline(0));
      buf.append(" *");
    }

    // add @see items for referenced classes
    Map<String, Class> classMap = new TreeMap<String, Class>();
    if (clss.getSuperClasses() != null && clss.getSuperClasses().size() > 0)
      this.collectProvisioningSuperclasses(pkg, clss, classMap);
    // for interfaces we have definitions for all methods generated
    // based on local fields, not fields from superclasses
    collectProvisioningClasses(pkg, clss, classMap);
    for (Class refClass : classMap.values()) {
      Namespace sdoNamespace = PlasmaConfig.getInstance().getSDONamespaceByURI(refClass.getUri());
      String packageName = sdoNamespace.getProvisioning().getPackageName();
      String packageQualifiedName = packageName + "." + refClass.getName();
      buf.append(newline(0));
      buf.append(" * @see ");
      buf.append(packageQualifiedName);
      buf.append(" ");
      buf.append(refClass.getName());
    }

    buf.append(newline(0));
    buf.append(" */"); // end javadoc

    return buf.toString();
  }