Exemplo n.º 1
0
  // meat of the processing
  public boolean run(Outline model, Options opt, ErrorHandler errorHandler) {
    for (ClassOutline co : model.getClasses()) {
      CPluginCustomization c = co.target.getCustomizations().find(Const.NS, "code");
      if (c == null) continue; // no customization --- nothing to inject here

      c.markAsAcknowledged();
      // TODO: ideally you should validate this DOM element to make sure
      // that there's no typo/etc. JAXP 1.3 can do this very easily.
      String codeFragment = DOMUtils.getElementText(c.element);

      // inject the specified code fragment into the implementation class.
      co.implClass.direct(codeFragment);
    }

    return true;
  }
 public JType toType(Outline o, Aspect aspect) {
   return o.getCodeModel().ref(Element.class);
 }
Exemplo n.º 3
0
 public JClass toType(Outline o, Aspect aspect) {
   if (clazz == null) clazz = o.getCodeModel().ref(fullyQualifiedClassName);
   return clazz;
 }