Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.JavaSource


       return jm;
     }
     public JavaSource generate(JavaSourceFactory pImplementationFactory,
                 JavaQName pTargetClass,
                 ProxyGenerator.InterfaceDescription[] pDescription) {
       JavaSource result = super.generate(pImplementationFactory, pTargetClass, pDescription);
       getGetHeadOfChainMethod(result);
       return result;
     }
View Full Code Here


      if (pInterfaces[i] == null  ||  pInterfaces[i].interfaceClass == null) {
        throw new NullPointerException("The interfaces being implemented must be non-null");
      }
     }

    JavaSource js = getJavaSource(pFactory, pTargetName);
    if (getExtendedClass() != null) {
      js.addExtends(getExtendedClass());
    }
    for (int i = 0;  i < pInterfaces.length;  i++) {
      js.addImplements(pInterfaces[i].getInterface());
    }

    getBackingObjectField(js, pInterfaces);
    getConstructor(js, pInterfaces);
View Full Code Here

  * @param pItems The enumeration items; a public, static, final instance
  *   will be generated for any element in the array
  */
  public JavaSource generate(JavaSourceFactory pFactory, JavaQName pTargetClass,
                             Item[] pItems) {
   JavaSource result = pFactory.newJavaSource(pTargetClass, JavaSource.PUBLIC);
    doGenerate(result, pItems);
   return result;
  }
View Full Code Here

      controllerDescription.setMandatory(true);
      ProxyGenerator.InterfaceDescription[] interfaces =
        new ProxyGenerator.InterfaceDescription[]{controllerDescription};

      ProxyGenerator proxyInterfaceGenerator = new ProxyInterfaceGenerator();
      JavaSource proxyInterface = proxyInterfaceGenerator.generate(pFactory, getChainInterface(), interfaces);
      proxyInterface.setType(JavaSource.INTERFACE);

      ProxyGenerator proxyImpGenerator = new ProxyImplementationGenerator();
      JavaSource proxyImplementation = proxyImpGenerator.generate(pFactory, getProxyClass(), interfaces);

      ProxyGenerator controllerImplementationGenerator = new ControllerImplementationGenerator();
      JavaSource controllerImplementation = controllerImplementationGenerator.generate(pFactory, getImplementationClass(), interfaces);

      return new JavaSource[]{controllerImplementation, proxyInterface, proxyImplementation};
   }
View Full Code Here

          columnUpdater = new IdIncrementer(pkColumns);
        }
        versionGenerator.addTable(table, columnUpdater);
      }

      JavaSource js = pFactory.newJavaSource(pTargetClass);
      versionGenerator.getCloneMethod(js);
    }
View Full Code Here

    JavaSourceFactory javaSourceFactory = new JavaSourceFactory();
    JavaParser javaParser = new JavaParser(javaSourceFactory);
    javaParser.parse(f);
    Iterator iter = javaSourceFactory.getJavaSources();
    while (iter.hasNext()) {
      JavaSource sourceClass = (JavaSource) iter.next();
      JavaQName classQualifiedName = sourceClass.getQName();
      if (pattern.matcher(classQualifiedName.toString()).matches()) {
        logger.fine("class " + classQualifiedName.toString()
            + " matches pattern, but is it a valid bean ?");
        // As soon as class matches pattern, we consider it to be a
        // valid bean and start generating the informer interface
View Full Code Here

    JavaSourceFactory factory = new JavaSourceFactory();
    factory.setOverwriteForced(true);
    // Let the factory create a Java source class
    // "com.mycompany.demo.Parser"
    JavaQName className = getBusinessInformer(sourceClass.getQName());
    JavaSource js = factory.newJavaSource(className, "public");
    JavaComment comment = js.newComment();
    comment.addLine("");
    comment.addLine("Define improved Informer for "+sourceClass.getClassName()+".");
    comment.addLine("Elements of this method allows easier usage of improved gaedo finders.");
    comment.addLine("The instances of FieldInformer used for that class various fields have been chosen according to FieldInformerLocator current implementation.");
    comment.addLine("As a consequence, the behaviour of this method has guaranteed comaptibilty with most of gaedo code");
    comment.addLine("");
    comment.addLine("@see "+sourceClass.getQName().toString());
    comment.addSee(JavaQNameImpl.getInstance(FieldInformer.class).toString());
    comment.addSee(JavaQNameImpl.getInstance(FieldInformerLocator.class).toString());
    comment.addAuthor("created by gaedo-informer generator on "+format.format(new Date()));
    js.setDynamicImports(true);
    js.setType(js.INTERFACE);
    js.setProtection(js.PUBLIC);
    js.addExtends(Informer.class);
    JavaField[] fields = sourceClass.getFields();
    for(JavaField f : fields) {
      if(isWritable(f))
        createDeclaration(js, sourceClass, f);
    }
View Full Code Here

    }
    return jm;
  }

  public JavaMethod newStartElementMethod() throws SAXException {
    JavaSource js = getJavaSource();
    JavaMethod jm = js.newJavaMethod("startElement", boolean.class, JavaSource.PUBLIC);
    DirectAccessible pNamespaceURI = jm.addParam(String.class, "pNamespaceURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    DirectAccessible pAttr = jm.addParam(Attributes.class, "pAttr");
    setParamNamespaceURI(pNamespaceURI);
View Full Code Here

    }
    return false;
  }

  private void generateAttributes(ComplexTypeSG pType) throws SAXException {
    JavaSource js = getJavaSource();
    AttributeSG[] myAttributes = pType.getAttributes();
    AttributeSG[] inheritedAttributes = null;
    if (pType.getTypeSG().isExtension()) {
      TypeSG tSG = pType.getTypeSG().getExtendedType();
      if (tSG.isComplex()) {
View Full Code Here

    pType.getSimpleContentSG().getPropertySG().generate(getJavaSource());
  }

  protected JavaMethod getGetMixedContentMethod() {
    if (mixedContentMethod == null) {
      JavaSource js = getJavaSource();
      JavaMethod jm = js.newJavaMethod("getContent", List.class, JavaSource.PUBLIC);
      if (!js.isInterface()) {
        JavaField mixedContentList = getJavaSource().newJavaField("content", List.class, JavaSource.PRIVATE);
        mixedContentList.setFinal(true);
        mixedContentList.addLine("new ", ArrayList.class, "()");
        jm.addLine("return ", mixedContentList, ";");
      }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.js.JavaSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.