Search in sources :

Example 1 with WikiClassProperty

use of org.xwiki.filter.xar.internal.input.ClassPropertyReader.WikiClassProperty in project xwiki-platform by xwiki.

the class AbstractWikiObjectPropertyReader method readObjectProperty.

public WikiObjectProperty readObjectProperty(XMLStreamReader xmlReader, XARInputProperties properties, WikiClass wikiClass) throws XMLStreamException, FilterException {
    xmlReader.nextTag();
    WikiObjectProperty property = new WikiObjectProperty();
    property.name = xmlReader.getLocalName();
    String type;
    if (wikiClass != null) {
        WikiClassProperty classProperty = wikiClass.properties.get(property.name);
        type = classProperty != null ? classProperty.type : null;
    } else {
        type = properties.getObjectPropertyType();
    }
    try {
        property.value = this.propertySerializerManager.getPropertySerializer(type).read(xmlReader);
    } catch (ComponentLookupException e) {
        throw new FilterException("Failed to get a property parser", e);
    }
    property.parameters.put(WikiObjectPropertyFilter.PARAMETER_TYPE, type);
    xmlReader.nextTag();
    return property;
}
Also used : ComponentLookupException(org.xwiki.component.manager.ComponentLookupException) FilterException(org.xwiki.filter.FilterException) WikiClassProperty(org.xwiki.filter.xar.internal.input.ClassPropertyReader.WikiClassProperty)

Aggregations

ComponentLookupException (org.xwiki.component.manager.ComponentLookupException)1 FilterException (org.xwiki.filter.FilterException)1 WikiClassProperty (org.xwiki.filter.xar.internal.input.ClassPropertyReader.WikiClassProperty)1