Examples of PropertyDeclaration


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

    rootElementDeclaration = new RootElementDeclaration(decl, type);
    model.add(type);
    model.add(rootElementDeclaration);

    ComplexTypeDefinition typeDef = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.ElementRefsBean"));
    PropertyDeclaration property = findProperty(typeDef, "beanOnes");
    ElementRef element = new ElementRef(property, typeDef);
    Collection<ElementRef> choices = element.getChoices();
    assertEquals(3, choices.size());
    Iterator<ElementRef> iterator = choices.iterator();
//    ElementRef firstChoice = iterator.next();
View Full Code Here

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

    rootElementDeclaration = new RootElementDeclaration(decl, type);
    model.add(type);
    model.add(rootElementDeclaration);

    ComplexTypeDefinition typeDef = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.ElementRefsBean"));
    PropertyDeclaration property = findProperty(typeDef, "foursAndThrees");
    ElementRef element = new ElementRef(property, typeDef);
    Collection<ElementRef> choices = element.getChoices();
    assertEquals(2, choices.size());
    Iterator<ElementRef> iterator = choices.iterator();
    ElementRef firstChoice = iterator.next();
View Full Code Here

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

  /**
   * Tests a default, simple, single-valued accessor
   */
  public void testSimpleSingleValuedProperty() throws Exception {
    ComplexTypeDefinition typeDef = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.ElementBeanOne"));
    PropertyDeclaration property = findProperty(typeDef, "property4");
    Element element = new Element(property, typeDef);
    assertEquals(1, element.getChoices().size());
    assertSame(element, element.getChoices().iterator().next());
    assertEquals("property4", element.getName());
    assertNull("The namespace should be null because the elementFormDefault is unset.", element.getNamespace());
    assertNull(element.getRef());
    assertEquals(property.getPropertyType(), element.getAccessorType());
    assertEquals(KnownXmlType.STRING, element.getBaseType());
    assertFalse(element.isNillable());
    assertFalse(element.isRequired());
    assertEquals(0, element.getMinOccurs());
    assertEquals("1", element.getMaxOccurs());
View Full Code Here

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

  /**
   * Tests a byte[] accessor
   */
  public void testByteArrayProperty() throws Exception {
    ComplexTypeDefinition typeDef = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.ElementBeanOne"));
    PropertyDeclaration property = findProperty(typeDef, "property6");
    Element element = new Element(property, typeDef);
    assertEquals(1, element.getChoices().size());
    assertSame(element, element.getChoices().iterator().next());
    assertEquals("property6", element.getName());
    assertNull("The namespace should be null because the elementFormDefault is unset.", element.getNamespace());
    assertNull(element.getRef());
    assertEquals(property.getPropertyType(), element.getAccessorType());
    assertEquals(KnownXmlType.BASE64_BINARY, element.getBaseType());
    assertFalse(element.isNillable());
    assertFalse(element.isRequired());
    assertTrue(element.isBinaryData());
    assertEquals(0, element.getMinOccurs());
    assertEquals("1", element.getMaxOccurs());
    assertNull(element.getDefaultValue());
    assertFalse(element.isWrapped());

    //now let's pretend its a value...
    Value value = new Value(property, typeDef);
    assertEquals(null, value.getName());
    assertEquals(property.getPropertyType(), value.getAccessorType());
    assertEquals(KnownXmlType.BASE64_BINARY, value.getBaseType());
    assertTrue(value.isBinaryData());
    assertFalse(((DecoratedTypeMirror) value.getAccessorType()).isPrimitive());
  }
View Full Code Here

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

   * Tests a looping accessor, as per the jaxb spec, section 8.9.1.2
   */
  public void testLoopingProperty() throws Exception {
    ComplexTypeDefinition typeDef = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.ElementBeanOne"));
    ((EnunciateFreemarkerModel) FreemarkerModel.get()).add(typeDef);
    PropertyDeclaration property = findProperty(typeDef, "loopingProperty1");
    Element element = new Element(property, typeDef);
    assertEquals(1, element.getChoices().size());
    assertSame(element, element.getChoices().iterator().next());
    assertEquals("loopingProperty1", element.getName());
    assertNull("The namespace should be null because the elementFormDefault is unset.", element.getNamespace());
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.PropertyDeclaration

            if (props.size() != 1) {
                throw new CSSParseException(
                        "Builder created " + props.size() + "properties, expected 1", getCurrentLine());
            }
           
            PropertyDeclaration decl = (PropertyDeclaration)props.get(0);
           
            return (PropertyValue)decl.getValue();
        } catch (IOException e) {
            // "Shouldn't" happen
            throw new RuntimeException(e.getMessage(), e);
        } catch (CSSParseException e) {
            error(e, "property value", false);
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.PropertyDeclaration

     */
    public static CascadedStyle createAnonymousStyle(IdentValue display) {
        CSSPrimitiveValue val = new PropertyValue(display);
       
        List props = Collections.singletonList(
                new PropertyDeclaration(CSSName.DISPLAY, val, true, StylesheetInfo.USER));
       
        return new CascadedStyle(props.iterator());
    }
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.PropertyDeclaration

     */
    public static PropertyDeclaration createLayoutPropertyDeclaration(
            CSSName cssName, IdentValue display) {
        CSSPrimitiveValue val = new PropertyValue(display);
        // Urk... kind of ugly, but we really want this value to be used
        return new PropertyDeclaration(cssName, val, true, StylesheetInfo.USER);
    }
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.PropertyDeclaration

        for (int i = 0; i < buckets.length; i++) {
            buckets[i] = new java.util.LinkedList();
        }

        while (iter.hasNext()) {
            PropertyDeclaration prop = (PropertyDeclaration) iter.next();
            buckets[prop.getImportanceAndOrigin()].add(prop);
        }

        for (int i = 0; i < buckets.length; i++) {
            for (java.util.Iterator it = buckets[i].iterator(); it.hasNext();) {
                PropertyDeclaration prop = (PropertyDeclaration) it.next();
                cascadedProperties.put(prop.getCSSName(), prop);
            }
        }
    }
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.PropertyDeclaration

     * @param cssName The CSS property name, e.g. "font-family".
     * @return The PropertyDeclaration, if declared in this set, or null
     *         if not found.
     */
    public PropertyDeclaration propertyByName(CSSName cssName) {
        PropertyDeclaration prop = (PropertyDeclaration)cascadedProperties.get(cssName);

        return prop;
    }
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.