Package com.sun.mirror.declaration

Examples of com.sun.mirror.declaration.ClassDeclaration


   * tests a basic collection element ref.
   */
  public void testBasicCollectionRef() throws Exception {
    EnunciateFreemarkerModel model = ((EnunciateFreemarkerModel) FreemarkerModel.get());

    ClassDeclaration decl = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.BeanOneDotOne");
    ComplexTypeDefinition type = new ComplexTypeDefinition(decl);
    RootElementDeclaration rootElementDeclaration = new RootElementDeclaration(decl, type);
    model.add(type);
    model.add(rootElementDeclaration);

View Full Code Here


   * tests a collection element ref.
   */
  public void testSuperTypeCollectionRef() throws Exception {
    EnunciateFreemarkerModel model = ((EnunciateFreemarkerModel) FreemarkerModel.get());

    ClassDeclaration decl = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.BeanOneDotOne");
    ComplexTypeDefinition type = new ComplexTypeDefinition(decl);
    RootElementDeclaration rootElementDeclaration = new RootElementDeclaration(decl, type);
    model.add(type);
    model.add(rootElementDeclaration);

View Full Code Here

   * tests a collection of specified element refs.
   */
  public void testSpecifiedElementsCollectionRef() throws Exception {
    EnunciateFreemarkerModel model = ((EnunciateFreemarkerModel) FreemarkerModel.get());

    ClassDeclaration decl = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.BeanOneDotOne");
    ComplexTypeDefinition type = new ComplexTypeDefinition(decl);
    RootElementDeclaration rootElementDeclaration = new RootElementDeclaration(decl, type);
    model.add(type);
    model.add(rootElementDeclaration);

View Full Code Here

        return false;
      }
    };
    FreemarkerModel.set(model);
    int nsCount = model.getNamespacesToPrefixes().size();
    ClassDeclaration declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanThree");
    TypeDefinition typeDef1 = new ComplexTypeDefinition(declaration);
    RootElementDeclaration element1 = new RootElementDeclaration(declaration, typeDef1);
    String targetNamespace = element1.getNamespace();
    assertNull(model.findRootElementDeclaration(element1));
    model.add(element1);
View Full Code Here

        FreemarkerModel.set(model);
    }

    public void testSchemaIdForType_PackageAnnotated()
    {
        final ClassDeclaration classDeclaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.json.Person");
        final String schemaId = JsonSchemaInfo.schemaIdForType(classDeclaration);
        assertEquals("samples.json", schemaId);
    }
View Full Code Here

        assertEquals("samples.json", schemaId);
    }

    public void testSchemaIdForType_PackageNotAnnotated()
    {
        final ClassDeclaration classDeclaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanOne");
        final String schemaId = JsonSchemaInfo.schemaIdForType(classDeclaration);
        assertEquals("org.codehaus.enunciate.samples.schema", schemaId);
    }
View Full Code Here

   * tests getting the base type and enum values.
   */
  public void testBasic() throws Exception {
    EnunciateFreemarkerModel model = new EnunciateFreemarkerModel();
    FreemarkerModel.set(model);
    ClassDeclaration decl = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.SimpleTypeSimpleContentBean");
    ComplexTypeDefinition type = new ComplexTypeDefinition(decl);
    model.add(type);

    EnumTypeDefinition bean1 = new EnumTypeDefinition((EnumDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.EnumBeanOne"));
    EnumTypeDefinition bean2 = new EnumTypeDefinition((EnumDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.EnumBeanTwo"));
View Full Code Here

    EnunciateFreemarkerModel model = new EnunciateFreemarkerModel();
    FreemarkerModel.set(model);

    model.add(new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.AdaptedBeanTwo")));

    ClassDeclaration adaptedBeanExamplesDeclaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.AdaptedBeanExamples");
    ComplexTypeDefinition examples = new ComplexTypeDefinition(adaptedBeanExamplesDeclaration);
    Accessor beanOneField = null;
    Accessor beanThreeField = null;
    Accessor beanFourField = null;
    Accessor stringBufferField = null;
View Full Code Here

    DeclaredType stringType = Context.getCurrentEnvironment().getTypeUtils().getDeclaredType(getDeclaration("java.lang.String"));
    XmlType stringXmlType = XmlTypeFactory.getXmlType(stringType);
    assertSame(KnownXmlType.STRING, stringXmlType);
    assertSame(stringXmlType, XmlTypeFactory.getXmlType(String.class));

    ClassDeclaration decl = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.BeanThree");
    ComplexTypeDefinition definition = new ComplexTypeDefinition(decl);
    model.add(definition);
    DeclaredType beanThreeType = Context.getCurrentEnvironment().getTypeUtils().getDeclaredType(decl);
    assertNotNull("The xml type for bean three should have been created.", XmlTypeFactory.getXmlType(beanThreeType));
  }
View Full Code Here

        return first;
      }
    };
    meth.setJdk15(true);

    ClassDeclaration decl = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.SelfReferencingClass");
    ComplexTypeDefinition ct = new ComplexTypeDefinition(decl);
    assertTrue(String.valueOf(meth.exec(Arrays.asList(ct))).startsWith("org.codehaus.enunciate.samples.client.schema.SelfReferencingClass"));

    decl = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.SelfReferencingPropertyBean");
    ct = new ComplexTypeDefinition(decl);
View Full Code Here

TOP

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

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.