Package net.sf.jelly.apt.decorations.declaration

Examples of net.sf.jelly.apt.decorations.declaration.PropertyDeclaration


  /**
   * test a wrapped element.
   */
  public void testWrappedElement() throws Exception {
    ComplexTypeDefinition typeDef = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.ElementBeanOne"));
    PropertyDeclaration property = findProperty(typeDef, "wrappedElementsProperty1");
    Element element = new Element(property, typeDef);
    assertEquals(1, element.getChoices().size());
    assertSame(element, element.getChoices().iterator().next());
    assertEquals("wrappedElementsProperty1", element.getName());
    assertNull(element.getNamespace());
    assertNotNull(element.getRef());
    assertEquals(property.getPropertyType(), element.getAccessorType());
    assertEquals(KnownXmlType.DECIMAL.getQname(), element.getBaseType().getQname());
    assertFalse(element.isNillable());
    assertFalse(element.isRequired());
    assertEquals(0, element.getMinOccurs());
    assertEquals("unbounded", element.getMaxOccurs());
View Full Code Here


    assertEquals("urn:wrapper1", element.getWrapperNamespace());
    assertTrue(element.isWrapperNillable());
  }

  protected PropertyDeclaration findProperty(DecoratedTypeDeclaration typeDef, String propertyName) {
    PropertyDeclaration prop = null;
    Collection<PropertyDeclaration> properties = typeDef.getProperties();
    for (PropertyDeclaration property : properties) {
      if (propertyName.equals(property.getSimpleName())) {
        prop = property;
      }
View Full Code Here

   */
  public void testGetAccessorType() throws Exception {
    ClassDeclaration declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanOne");
    ComplexTypeDefinition typeDef = new ComplexTypeDefinition(declaration);
    FieldDeclaration fieldDeclaration = declaration.getFields().iterator().next();
    PropertyDeclaration propertyDeclaration = typeDef.getProperties().iterator().next();

    assertEquals(fieldDeclaration.getType(), new MockAccessor(fieldDeclaration, typeDef).getAccessorType());
    assertEquals(propertyDeclaration.getPropertyType(), new MockAccessor(propertyDeclaration, typeDef).getAccessorType());
  }
View Full Code Here

TOP

Related Classes of net.sf.jelly.apt.decorations.declaration.PropertyDeclaration

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.