示例#1
0
  public EventPropertyGetter getGetterDOM() {
    List<EventPropertyGetter> getters = new LinkedList<EventPropertyGetter>();

    for (Iterator<Property> it = properties.iterator(); it.hasNext(); ) {
      Property property = it.next();
      EventPropertyGetter getter = property.getGetterDOM();
      if (getter == null) {
        return null;
      }

      getters.add(getter);
    }

    return new DOMNestedPropertyGetter(getters, null);
  }
示例#2
0
  public EventPropertyGetter getGetterDOM(
      SchemaElementComplex parentComplexProperty,
      EventAdapterService eventAdapterService,
      BaseXMLEventType eventType,
      String propertyExpression) {
    List<EventPropertyGetter> getters = new LinkedList<EventPropertyGetter>();

    SchemaElementComplex complexElement = parentComplexProperty;

    for (Iterator<Property> it = properties.iterator(); it.hasNext(); ) {
      Property property = it.next();
      EventPropertyGetter getter =
          property.getGetterDOM(complexElement, eventAdapterService, eventType, propertyExpression);
      if (getter == null) {
        return null;
      }

      if (it.hasNext()) {
        SchemaItem childSchemaItem =
            property.getPropertyTypeSchema(complexElement, eventAdapterService);
        if (childSchemaItem == null) {
          // if the property is not valid, return null
          return null;
        }

        if ((childSchemaItem instanceof SchemaItemAttribute)
            || (childSchemaItem instanceof SchemaElementSimple)) {
          return null;
        }

        complexElement = (SchemaElementComplex) childSchemaItem;

        if (complexElement.isArray()) {
          if ((property instanceof SimpleProperty) || (property instanceof DynamicSimpleProperty)) {
            return null;
          }
        }
      }

      getters.add(getter);
    }

    return new DOMNestedPropertyGetter(
        getters, new FragmentFactoryDOMGetter(eventAdapterService, eventType, propertyExpression));
  }