Examples of POJOClass


Examples of com.openpojo.reflection.PojoClass

  @Test
  public void testMissingMethods() {
    for(PojoClass nmsPacket : nmsPacketClasses) {
      try {
        String apiPacketName = "NMS" + nmsPacket.getClazz().getSimpleName();
        PojoClass apiPacket = PojoClassFactory.getPojoClass(Class.forName("com.bergerkiller.bukkit.common.protocol.PacketTypeClasses$" + apiPacketName));
        List<PojoField> expectedFields = nmsPacket.getPojoFields();
        List<PojoField> actualFields = apiPacket.getPojoFields();
        for(PojoField pojoField : expectedFields) {
          if(!pojoField.getName().equals("timestamp") && !pojoField.isStatic()) {
            PojoField actual = getFromList(actualFields, pojoField.getName(), apiPacket);
            Assert.assertNotNull("Method missing, could not find method named " + pojoField.getName() + " for " + nmsPacket.getClazz().getSimpleName(), actual);
            if(actual != null)
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

     *
     */
    public void generateEntitiesDetails(){
      Iterator classes = docHelper.getClasses().iterator();
      while(classes.hasNext()){
        POJOClass pcObj = (POJOClass)classes.next()
       
        pcObj.getPropertiesForMinimalConstructor();   
        DocFile docFile = docFileManager.getEntityDocFile(pcObj);
        File file = docFile.getFile();
       
        Map parameters = new HashMap();
        parameters.put("docFile", docFile);
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

        Iterator classesItr = cfg.getClassMappings();
        while (classesItr.hasNext() ) {
            PersistentClass clazz = (PersistentClass) classesItr.next();
           
            POJOClass pojoClazz = cfg2JavaTool.getPOJOClass(clazz);
            ConfigurationNavigator.collectComponents(components, pojoClazz);           
           
            this.processClass(pojoClazz);
           
            Iterator properties = clazz.getPropertyIterator();
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

   
    public List getInheritanceHierarchy(POJOClass pc) {
      if(pc.isSubclass()) {
        List superClasses = new ArrayList();

        POJOClass superClass = pc.getSuperClass();
        while (superClass != null)
        {
          superClasses.add(superClass);
          superClass = superClass.getSuperClass();
        }

        return superClasses;
      } else {
        return Collections.EMPTY_LIST;
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

            packageFolder = rootEntitiesDocFolder;
          }
         
          Iterator classes = docHelper.getClasses(packageName).iterator();
          while(classes.hasNext()){
            POJOClass pc = (POJOClass)classes.next();
            String classFileName = pc.getDeclarationName();           
            classFileName = classFileName + ".html";
            DocFile classDocFile = new DocFile(classFileName, packageFolder);           
            entityDocFiles.put(pc, classDocFile);
          }         
        }
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

      String pojoClassQualifiedDeclarationName ;
      //TODO Can we implement equals method in BasicPOJO to avoid this loop?
      if(df == null){
        Iterator itr = entityDocFiles.keySet().iterator();
        while(itr.hasNext()){
          POJOClass pojoClass = (POJOClass)itr.next();
          pojoClassQualifiedDeclarationName = pojoClass.getQualifiedDeclarationName();
         
          if( pcQualifiedDeclarationName.equals(pojoClassQualifiedDeclarationName )){
            df = (DocFile)entityDocFiles.get(pojoClass);
            break;
          }
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

     *
     */
    public void generateEntitiesDetails(){
      Iterator classes = docHelper.getClasses().iterator();
      while(classes.hasNext()){
        POJOClass pcObj = (POJOClass)classes.next()
       
        pcObj.getPropertiesForMinimalConstructor();   
        DocFile docFile = docFileManager.getEntityDocFile(pcObj);
        File file = docFile.getFile();
       
        Map parameters = new HashMap();
        parameters.put("docFile", docFile);
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

    PersistentClass pc = getCfg().getClassMapping(
        "org.hibernate.tool.hbm2x.Order" );
    assertEquals( null, c2j.getPOJOClass(pc).getExtends() );

    POJOClass entityPOJOClass = c2j.getPOJOClass(getCfg().getClassMapping(
    "HelloWorld" ));
    assertEquals( "Comparable", entityPOJOClass.getExtends() );
    assertEquals( "should be interface which cannot have implements", null,
        entityPOJOClass.getImplements() );
    assertEquals( "should be interface which cannot have implements", "",
        entityPOJOClass.getImplementsDeclaration() );

    PersistentClass base = new RootClass();
    base.setClassName( "Base" );

    PersistentClass sub = new SingleTableSubclass( base );
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

    PersistentClass pc = getCfg().getClassMapping(
        "org.hibernate.tool.hbm2x.Order" );
    PersistentClass hw = getCfg().getClassMapping( "HelloWorld" );

    POJOClass epc = c2j.getPOJOClass(pc);
   
    assertEquals( "Order", epc.getDeclarationName() );
   
    epc = c2j.getPOJOClass(hw);
    assertEquals( "BaseHelloWorld", epc.getDeclarationName() );

  }
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass

  public void testPropertiesForFullConstructor() {
    Cfg2JavaTool c2j = new Cfg2JavaTool();

    PersistentClass pc = getCfg().getClassMapping( "HelloWorld" );
    POJOClass pjc = c2j.getPOJOClass(pc);
   
    List wl = pjc.getPropertiesForFullConstructor();
    assertEquals( 3, wl.size() );

    PersistentClass uni = getCfg().getClassMapping( "HelloUniverse" );
    pjc = c2j.getPOJOClass(uni);
    List local = pjc.getPropertyClosureForFullConstructor();
    assertEquals( 6, local.size() );

    for(int i=0;i<wl.size();i++) {
      assertEquals( i + " position should be the same", local.get( i ), wl.get( i ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.