Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaClass


       
        // @TODO: check if tapestry is in the CP or will fail silently
    }

    public boolean shouldGenerate(Object metadata) {
        JavaClass clazz = (JavaClass) metadata;
        boolean hasPageTag = clazz.getTagByName("tapestry.page-specification") != null;
        boolean isAPage = clazz.isA("org.apache.tapestry.IPage");
        return hasPageTag && isAPage;
    }
View Full Code Here


        setMultioutput(true);
        new TagLibrary(metadataProvider);
    }

    public boolean shouldGenerate(Object metadata) {
        JavaClass clazz = (JavaClass) metadata;
        boolean hasComponentTag = clazz.getTagByName("tapestry.component-specification") != null;
        boolean isAComponent = clazz.isA("org.apache.tapestry.IComponent");
        return hasComponentTag && isAComponent;
    }
View Full Code Here

     * @param componentClassName
     * @param componentPropertyClass
     * @return
     */
    public List getComponentProperties(String componentClassName, JavaClass componentPropertyClass) {
        JavaClass componentClass;

        if (componentClassName != null) {
            componentClass = getMetadata(componentClassName);
        } else {
            componentClass = componentPropertyClass;
View Full Code Here

    public JavaClass getMetadata(final String className) {
        if (className == null) {
            throw new NullPointerException("Classname can't be null");
        }

        JavaClass javaClass = (JavaClass) CollectionUtils.find(getMetadata(),
                new Predicate() {
                    public boolean evaluate(Object o) {
                        JavaClass cl = (JavaClass) o;
                        return cl.getFullyQualifiedName().equals(className);
                    }
                });

        if (javaClass == null) {
            log.error("Sourcecode for class '" + className + "' not found by metadata povider");
View Full Code Here

     * whether we sould generate given class. we generate if class contains
     * hibernate.class tag on it. class could be as well abstract, because real
     * stuff lives in polymorphic subclasses
     */
    public boolean shouldGenerate(Object metadata) {
        JavaClass clazz = (JavaClass) metadata;

        //Check if mapping up-to-date then skip generation
        if (!force) {
            String packagePath = getDestinationPackage(metadata).replace('.', '/');
            File dir = new File(getDestdirFile(), packagePath);
            String filename = getDestinationFilename(metadata);
            File destFile = new File(dir, filename);
            File sourceFile = new File(clazz.getSource().getURL().getFile());

            if (destFile.exists() && sourceFile.lastModified() < destFile.lastModified()) {
                return false;
            }
        }

        // we refuse to generate if object is in restricted folder
        if(!super.shouldGenerate(metadata)) {
          return false;
        }
        boolean generate = clazz.getTagByName("hibernate.class") != null;

        if (generate) {
            System.out.println("  * Generate mapping for '" + clazz.getName() + "' entity");
        }

        return generate;
    }
View Full Code Here

            return;
        }

        accumulateProperties(clazz, requiredTags, accumulate);
        //Look at subclass
        JavaClass superclass = clazz.getSuperJavaClass();

        if (superclass != null) {
            accumulatePropertiesRecursive(superclass, stopTags, false, requiredTags, accumulate);
        }
View Full Code Here

  /**
   * Must be synch to be assured that a file is not parsed twice
   */
  private synchronized JavaClass getClassByName(Class clazz) {
    if(m_parsedClasses.containsKey(clazz.getName())) {
      JavaClass jc= m_docBuilder.getClassByName(clazz.getName());
      return jc;
    }
    else {
      parseSource(clazz);

View Full Code Here

    if(Object.class.equals(methodClass)) {
      return null;
    }
   
    IAnnotation result = null;
    JavaClass jc = getClassByName(methodClass);
    if (jc != null) {
      List<JavaMethod> methods = new ArrayList<JavaMethod>();
      JavaMethod[] allMethods = jc.getMethods();
      for (int i = 0; i < allMethods.length; i++) {
        JavaMethod jm = allMethods[i];
        if (methodsAreEqual(jm, methodName, parameterTypes)) {
          methods.add(jm);
        }
View Full Code Here

                JavaMethod javaMethod = (JavaMethod) entity;
                msg.append( getJavaMethodAsString( javaMethod ) );
            }
            else
            {
                JavaClass javaClass = (JavaClass) entity;
                msg.append( javaClass.getFullyQualifiedName() );
            }

            return msg.toString();
        }
View Full Code Here

            if ( javaClasses != null )
            {
                for ( int i = 0; i < javaClasses.length; i++ )
                {
                    JavaClass javaClass = javaClasses[i];

                    processFix( javaClass );
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.thoughtworks.qdox.model.JavaClass

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.