Package com.sun.mirror.util

Examples of com.sun.mirror.util.SourcePosition


        // APT supports the operation mode where it creates Declarations from
        // a class file, in which case the source position is not available
        // use that as a key to sort them correctly. This isn't "correct" in
        // the sense that it relies on undocumented behavior of APT where
        // it returns declarations in the reverse order, but this makes things work.
        SourcePosition pos = l.get(0).getPosition();
        if(pos!=null)
            Collections.sort(l,SOURCE_POS_COMPARATOR);
        else
            Collections.reverse(l);
        return l;
View Full Code Here


    else if (accessOrder == XmlAccessOrder.ALPHABETICAL) {
      return propertyName1.compareTo(propertyName2);
    }

    //If no order is specified, it's undefined. We'll put it in source order.
    SourcePosition position1 = accessor1.getPosition();
    SourcePosition position2 = accessor2.getPosition();
    int comparison;
    if ((position1 != null) && (position2 != null)) {
      comparison = position1.line() - position2.line();
      if (comparison == 0) {
        comparison = accessor1.getPosition().column() - accessor2.getPosition().column();
      }
    }
    else {
View Full Code Here

      AntPatternMatcher matcher = new AntPatternMatcher();
      matcher.setPathSeparator(".");
      for (WebFault webFault : allFaults.values()) {
        if (useServerSide(webFault, matcher)) {
          SourcePosition position = webFault.getPosition();
          if (position == null || position.file() == null) {
            throw new IllegalStateException("Unable to find source file for " + webFault.getQualifiedName());
          }
          File sourceFile = position.file();
          getEnunciate().copyFile(sourceFile, getServerSideDestFile(sourceFile, webFault));
        }
        else {
          ClassDeclaration superFault = webFault.getSuperclass().getDeclaration();
          if (superFault != null && allFaults.containsKey(superFault.getQualifiedName()) && allFaults.get(superFault.getQualifiedName()).isImplicitSchemaElement()) {
            model.put("superFault", allFaults.get(superFault.getQualifiedName()));
          }
          else {
            model.remove("superFault");
          }

          model.put("fault", webFault);
          processTemplate(faultTemplate, model);
        }
      }

      final Set<String> uniquePackages = new TreeSet<String>();
      for (SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (FacetFilter.accept(typeDefinition)) {
            if (useServerSide(typeDefinition, matcher)) {
              SourcePosition position = typeDefinition.getPosition();
              if (position == null || position.file() == null) {
                throw new IllegalStateException("Unable to find source file for " + typeDefinition.getQualifiedName());
              }
              File sourceFile = position.file();
              getEnunciate().copyFile(sourceFile, getServerSideDestFile(sourceFile, typeDefinition));
            }
            else {
              model.put("rootEl", model.findRootElementDeclaration(typeDefinition));
              model.put("type", typeDefinition);
View Full Code Here

        // APT supports the operation mode where it creates Declarations from
        // a class file, in which case the source position is not available
        // use that as a key to sort them correctly. This isn't "correct" in
        // the sense that it relies on undocumented behavior of APT where
        // it returns declarations in the reverse order, but this makes things work.
        SourcePosition pos = l.get(0).getPosition();
        if(pos!=null)
            Collections.sort(l,SOURCE_POS_COMPARATOR);
        else
            Collections.reverse(l);
        return l;
View Full Code Here

        typeDecl = d;
        if (serviceImplName == null)
            serviceImplName = d.getQualifiedName();
        String endpointInterfaceName = webService != null ? webService.endpointInterface() : null;
        if (endpointInterfaceName != null && endpointInterfaceName.length() > 0) {
            SourcePosition pos = pos = d.getPosition();
            checkForInvalidImplAnnotation(d, SOAPBinding.class);
            if (webService.name().length() > 0)
                annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT("name"));
            endpointReferencesInterface = true;
            verifyImplAnnotations(d);
View Full Code Here

    }

    protected void checkForInvalidSEIAnnotation(InterfaceDeclaration d, Class annotationClass) {
        Object annotation = d.getAnnotation(annotationClass);
        if (annotation != null) {
            SourcePosition pos = d.getPosition();
            annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(annotationClass.getName(), d.getQualifiedName()));
        }
    }
View Full Code Here

    }

    protected void checkForInvalidImplAnnotation(Declaration d, Class annotationClass) {
        Object annotation = d.getAnnotation(annotationClass);
        if (annotation != null) {
            SourcePosition pos = d.getPosition();
            annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(annotationClass.getName()));
        }
    }
View Full Code Here

        // APT supports the operation mode where it creates Declarations from
        // a class file, in which case the source position is not available
        // use that as a key to sort them correctly. This isn't "correct" in
        // the sense that it relies on undocumented behavior of APT where
        // it returns declarations in the reverse order, but this makes things work.
        SourcePosition pos = l.get(0).getPosition();
        if(pos!=null)
            Collections.sort(l,SOURCE_POS_COMPARATOR);
        else
            Collections.reverse(l);
        return l;
View Full Code Here

        typeDecl = d;
        if (serviceImplName == null)
            serviceImplName = d.getQualifiedName();
        String endpointInterfaceName = webService != null ? webService.endpointInterface() : null;
        if (endpointInterfaceName != null && endpointInterfaceName.length() > 0) {
            SourcePosition pos = pos = d.getPosition();
            checkForInvalidImplAnnotation(d, SOAPBinding.class);
            if (webService.name().length() > 0)
                annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT("name"));
            endpointReferencesInterface = true;
            verifyImplAnnotations(d);
View Full Code Here

    }

    protected void checkForInvalidSEIAnnotation(InterfaceDeclaration d, Class annotationClass) {
        Object annotation = d.getAnnotation(annotationClass);
        if (annotation != null) {
            SourcePosition pos = d.getPosition();
            annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(annotationClass.getName(), d.getQualifiedName()));
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.mirror.util.SourcePosition

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.