Package org.codehaus.enunciate.template.freemarker

Examples of org.codehaus.enunciate.template.freemarker.ClientPackageForMethod


      ClientClassnameForMethod classnameFor = new ClientClassnameForMethod(conversions);
      classnameFor.setJdk15(true);
      OverlayClientClassnameForMethod overlayClassnameFor = new OverlayClientClassnameForMethod(overlayConversions);
      overlayClassnameFor.setJdk15(true);
      model.put("packageFor", new ClientPackageForMethod(conversions));
      model.put("overlayPackageFor", new ClientPackageForMethod(overlayConversions));
      model.put("isAccessorOfTypeLong", new IsAccessorOfTypeLongMethod());
      model.put("classnameFor", classnameFor);
      model.put("overlayClassnameFor", overlayClassnameFor);
      model.put("simpleNameFor", new SimpleNameWithParamsMethod(classnameFor));
      model.put("overlaySimpleNameFor", new SimpleNameWithParamsMethod(overlayClassnameFor));
View Full Code Here


    if (!isUpToDate()) {
      EnunciateFreemarkerModel model = getModel();
      Map<String, String> conversions = Collections.<String, String>emptyMap();
      ClassnameForMethod classnameFor = new ClassnameForMethod(conversions);
      classnameFor.setJdk15(true);
      model.put("packageFor", new ClientPackageForMethod(conversions));
      model.put("classnameFor", classnameFor);
      model.put("simpleNameFor", new SimpleNameWithParamsMethod(classnameFor));
      model.put("docsDir", enunciate.getProperty("docs.webapp.dir"));
      URL configTemplate = isSpringEnabled() ? getJAXWSSpringTemplateURL() : getSunJAXWSTemplateURL();
      File configDir = getConfigGenerateDir();
View Full Code Here

          schemaTypes.add(position, typeDefinition);
        }
      }
      model.put("schemaTypes", schemaTypes);
      model.put("packages2modules", this.packageToModuleConversions);
      ClientPackageForMethod moduleFor = new ClientPackageForMethod(this.packageToModuleConversions);
      moduleFor.setUseClientNameConversions(true);
      model.put("moduleFor", moduleFor);
      ClientClassnameForMethod classnameFor = new ClientClassnameForMethod(this.packageToModuleConversions);
      classnameFor.setUseClientNameConversions(true);
      model.put("classnameFor", classnameFor);
      TypeNameForMethod typeNameFor = new TypeNameForMethod(this.packageToModuleConversions);
View Full Code Here

  @Override
  public void doFreemarkerGenerate() throws IOException, TemplateException {
    File genDir = getGenerateDir();
    if (!enunciate.isUpToDateWithSources(genDir)) {
      EnunciateFreemarkerModel model = getModel();
      ClientPackageForMethod namespaceFor = new ClientPackageForMethod(this.packageToNamespaceConversions);
      namespaceFor.setUseClientNameConversions(true);
      model.put("namespaceFor", namespaceFor);
      model.put("findRootElement", new FindRootElementMethod());
      model.put("requestDocumentQName", new RequestDocumentQNameMethod());
      model.put("responseDocumentQName", new ResponseDocumentQNameMethod());
      ClientClassnameForMethod classnameFor = new ClientClassnameForMethod(this.packageToNamespaceConversions);
View Full Code Here

  public void testClientPackageFor() throws Exception {
    BeansWrapper wrapper = BeansWrapper.getDefaultInstance();
    HashMap<String, String> conversions = new HashMap<String, String>();
    conversions.put("org.codehaus.enunciate.samples", "red.herring");
    conversions.put("org.codehaus.enunciate.samples.xfire_client.with.a.nested", "org.codehaus.enunciate.other.pckg.and.nested");
    ClientPackageForMethod packageForMethod = new ClientPackageForMethod(conversions);
    TypeDeclaration typeDeclaration = getDeclaration("org.codehaus.enunciate.samples.xfire_client.with.a.nested.pckg.NestedPackageClass");
    assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg", packageForMethod.exec(Arrays.asList(wrapper.wrap(typeDeclaration))));
    assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg", packageForMethod.exec(Arrays.asList(wrapper.wrap(typeDeclaration.getPackage()))));
    assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg.plus.extra", packageForMethod.exec(Arrays.asList(wrapper.wrap("org.codehaus.enunciate.samples.xfire_client.with.a.nested.pckg.plus.extra"))));
    assertEquals("red.herring.xfire_client", packageForMethod.exec(Arrays.asList(wrapper.wrap("org.codehaus.enunciate.samples.xfire_client"))));
    for (FieldDeclaration fieldDeclaration : typeDeclaration.getFields()) {
      if ("items".equals(fieldDeclaration.getSimpleName())) {
        assertEquals("java.util", packageForMethod.exec(Arrays.asList(wrapper.wrap(fieldDeclaration.getType()))));
      }
      else if ("type".equals(fieldDeclaration.getSimpleName())) {
        assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg", packageForMethod.exec(Arrays.asList(wrapper.wrap(fieldDeclaration.getType()))));
      }
    }
  }
View Full Code Here

          schemaTypes.add(position, typeDefinition);
        }
      }
      model.put("schemaTypes", schemaTypes);
      model.put("packages2modules", this.packageToModuleConversions);
      ClientPackageForMethod moduleFor = new ClientPackageForMethod(this.packageToModuleConversions);
      moduleFor.setUseClientNameConversions(true);
      model.put("moduleFor", moduleFor);
      ClientClassnameForMethod classnameFor = new ClientClassnameForMethod(this.packageToModuleConversions);
      classnameFor.setUseClientNameConversions(true);
      model.put("classnameFor", classnameFor);
      SimpleNameWithParamsMethod simpleNameFor = new SimpleNameWithParamsMethod(classnameFor);
View Full Code Here

      }

      model.setFileOutputDirectory(clientGenerateDir);
      HashMap<String, String> conversions = new HashMap<String, String>();
      //todo: accept client-side package mappings?
      ClientPackageForMethod as3PackageFor = new ClientPackageForMethod(conversions);
      as3PackageFor.setUseClientNameConversions(true);
      model.put("packageFor", as3PackageFor);
      AS3UnqualifiedClassnameForMethod as3ClassnameFor = new AS3UnqualifiedClassnameForMethod(conversions);
      as3ClassnameFor.setUseClientNameConversions(true);
      model.put("classnameFor", as3ClassnameFor);
      model.put("simpleNameFor", new SimpleNameWithParamsMethod(as3ClassnameFor));
View Full Code Here

TOP

Related Classes of org.codehaus.enunciate.template.freemarker.ClientPackageForMethod

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.