Package com.sun.mirror.declaration

Examples of com.sun.mirror.declaration.PackageDeclaration


  }

  @Override
  public String convert(TypeDeclaration declaration) throws TemplateModelException {
    PackageDeclaration pkg = declaration.getPackage();
    String convertedPackage = convertPackage(pkg);
    String simpleName = declaration.getSimpleName();
    return convertedPackage + getPackageSeparator() + simpleName;
  }
View Full Code Here


        for (String name : documentationGroup.value()) {
          facets.add(new Facet(DocumentationGroup.class.getName(), name, new JavaDoc(decl.getDocComment()).toString()));
        }
      }
      else if (decl instanceof TypeDeclaration) {
        PackageDeclaration pkg = ((TypeDeclaration)decl).getPackage();
        if (pkg != null) {
          documentationGroup = pkg.getAnnotation(DocumentationGroup.class);
          if (documentationGroup != null) {
            for (String name : documentationGroup.value()) {
              facets.add(new Facet(DocumentationGroup.class.getName(), name, new JavaDoc(pkg.getDocComment()).toString()));
            }
          }
        }
      }
    }
View Full Code Here

   * @throws java.lang.AssertionError if the parameter conditions are not met and assertions are enabled.
   */
  public static String schemaIdForType(final ClassDeclaration delegate) {
    assert delegate != null;

    final PackageDeclaration schemaPackage = delegate.getPackage();
    return schemaIdForPackage(schemaPackage);
  }
View Full Code Here

    XmlType xmlType = null;
    XmlSchemaType schemaType = accessor.getAnnotation(XmlSchemaType.class);

    if ((schemaType == null) && (typeMirror instanceof DeclaredType)) {
      PackageDeclaration pckg = accessor.getDeclaringType().getPackage();
      String packageName = pckg.getQualifiedName();
      HashMap<String, XmlSchemaType> explicitTypes = EXPLICIT_ELEMENTS_BY_PACKAGE.get(packageName);
      if (explicitTypes == null) {
        explicitTypes = new HashMap<String, XmlSchemaType>();
        EXPLICIT_ELEMENTS_BY_PACKAGE.put(packageName, explicitTypes);

        XmlSchemaType schemaTypeInfo = pckg.getAnnotation(XmlSchemaType.class);
        XmlSchemaTypes schemaTypes = pckg.getAnnotation(XmlSchemaTypes.class);

        if ((schemaTypeInfo != null) || (schemaTypes != null)) {
          ArrayList<XmlSchemaType> allSpecifiedTypes = new ArrayList<XmlSchemaType>();
          if (schemaTypeInfo != null) {
            allSpecifiedTypes.add(schemaTypeInfo);
          }

          if (schemaTypes != null) {
            allSpecifiedTypes.addAll(Arrays.asList(schemaTypes.value()));
          }

          for (XmlSchemaType specifiedType : allSpecifiedTypes) {
            String typeFqn;
            try {
              Class specifiedClass = specifiedType.type();
              if (specifiedClass == XmlSchemaType.DEFAULT.class) {
                throw new ValidationException(pckg.getPosition(), pckg.getQualifiedName() + ": a type must be specified in " + XmlSchemaType.class.getName() + " at the package-level.");
              }
              typeFqn = specifiedClass.getName();
            }
            catch (MirroredTypeException e) {
              TypeMirror explicitTypeMirror = e.getTypeMirror();
              if (!(explicitTypeMirror instanceof DeclaredType)) {
                throw new ValidationException(pckg.getPosition(), pckg.getQualifiedName() + ": only a declared type can be adapted.  Offending type: " + explicitTypeMirror);
              }
              typeFqn = ((DeclaredType) explicitTypeMirror).getDeclaration().getQualifiedName();
            }

            explicitTypes.put(typeFqn, specifiedType);
View Full Code Here

    String simpleNameDecap = ObjCDeploymentModule.scrubIdentifier(Introspector.decapitalize(simpleName));
    String clientNameDecap = ObjCDeploymentModule.scrubIdentifier(Introspector.decapitalize(clientName));
    if (name == null) {
      name = "anonymous_" + clientNameDecap;
    }
    PackageDeclaration pckg = ((TypeDeclaration) typeDefinition).getPackage();
    String packageName = pckg == null ? "" : pckg.getQualifiedName();
    String packageIdentifier = this.packages2ids.containsKey(packageName) ? ObjCDeploymentModule.scrubIdentifier(this.packages2ids.get(packageName)) : ObjCDeploymentModule.scrubIdentifier(packageName);
    String nsid = ObjCDeploymentModule.scrubIdentifier(namespaces2ids.get(typeDefinition.getNamespace()));
    return String.format(this.pattern, this.projectLabel, nsid, name, clientName, clientNameDecap, simpleName, simpleNameDecap, packageIdentifier);
  }
View Full Code Here

    String simpleNameDecap = ObjCDeploymentModule.scrubIdentifier(Introspector.decapitalize(simpleName));
    String clientNameDecap = ObjCDeploymentModule.scrubIdentifier(Introspector.decapitalize(clientName));
    if (name == null) {
      name = "anonymous_" + clientNameDecap;
    }
    PackageDeclaration pckg = ((TypeDeclaration) typeDefinition).getPackage();
    String packageName = pckg == null ? "" : pckg.getQualifiedName();
    String packageIdentifier = this.packages2ids.containsKey(packageName) ? ObjCDeploymentModule.scrubIdentifier(this.packages2ids.get(packageName)) : ObjCDeploymentModule.scrubIdentifier(packageName);
    String nsid = ObjCDeploymentModule.scrubIdentifier(namespaces2ids.get(typeDefinition.getNamespace()));

    String constantName = ObjCDeploymentModule.scrubIdentifier(constant.getSimpleName());
    String constantClientName = ObjCDeploymentModule.scrubIdentifier(constant.getAnnotation(ClientName.class) != null ? constant.getAnnotation(ClientName.class).value() : constantName);
View Full Code Here

   */
  public void doFreemarkerGenerate() throws EnunciateException, IOException, TemplateException {
    if (!getEnunciate().isUpToDateWithSources(getGenerateDir())) {
      EnunciateFreemarkerModel model = getModel();
      if (this.splashPackage != null) {
        PackageDeclaration packageDeclaration = Context.getCurrentEnvironment().getPackage(this.splashPackage);
        if (packageDeclaration != null) {
          debug("Including documentation for package %s as the splash documentation.", this.splashPackage);
          model.setVariable("apiDoc", new DecoratedPackageDeclaration(packageDeclaration).getJavaDoc());
        }
        else {
View Full Code Here

    String simpleNameDecap = CDeploymentModule.scrubIdentifier(Introspector.decapitalize(simpleName));
    String clientNameDecap = CDeploymentModule.scrubIdentifier(Introspector.decapitalize(clientName));
    if (name == null) {
      name = "anonymous_" + clientNameDecap;
    }
    PackageDeclaration pckg = ((TypeDeclaration) typeDefinition).getPackage();
    String packageUnderscored = CDeploymentModule.scrubIdentifier(pckg != null ? pckg.getQualifiedName() : "");
    String nsid = CDeploymentModule.scrubIdentifier(namespaces2ids.get(typeDefinition.getNamespace()));
    return String.format(this.pattern, this.projectLabel, nsid, name, clientName, clientNameDecap, simpleName, simpleNameDecap, packageUnderscored);
  }
View Full Code Here

    String simpleNameDecap = CDeploymentModule.scrubIdentifier(Introspector.decapitalize(simpleName));
    String clientNameDecap = CDeploymentModule.scrubIdentifier(Introspector.decapitalize(clientName));
    if (name == null) {
      name = "anonymous_" + clientNameDecap;
    }
    PackageDeclaration pckg = ((TypeDeclaration) typeDefinition).getPackage();
    String packageUnderscored = CDeploymentModule.scrubIdentifier(pckg != null ? pckg.getQualifiedName().replace('.', '_') :"");
    String nsid = CDeploymentModule.scrubIdentifier(namespaces2ids.get(typeDefinition.getNamespace()));

    String constantName = CDeploymentModule.scrubIdentifier(constant.getSimpleName());
    String constantClientName = CDeploymentModule.scrubIdentifier(constant.getAnnotation(ClientName.class) != null ? constant.getAnnotation(ClientName.class).value() : constantName);
    return String.format(this.pattern, this.projectLabel, nsid, name, clientName, clientNameDecap, simpleName, simpleNameDecap, packageUnderscored, constantClientName, constantName);
View Full Code Here

TOP

Related Classes of com.sun.mirror.declaration.PackageDeclaration

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.