OrderedPropertyDefinition.java
1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.resource.ModifiableValueMap
* org.apache.sling.api.resource.PersistenceException
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ResourceResolver
*/
package com.adobe.cq.dam.index.builder;
import com.adobe.cq.dam.index.builder.SimplePropertyDefinition;
import com.adobe.cq.dam.index.builder.api.PropertyDefinition;
import org.apache.sling.api.resource.ModifiableValueMap;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
public class OrderedPropertyDefinition
extends SimplePropertyDefinition
implements PropertyDefinition {
boolean ordered = true;
String propertyType;
public OrderedPropertyDefinition(String property, String nodeName, String propertyType) {
super(property, nodeName);
this.setPropertyType(propertyType);
}
public OrderedPropertyDefinition(String property, String nodeName, String propertyType, float boost) {
this(property, nodeName, propertyType);
this.setBoost(boost);
}
@Override
public void setPropertyType(String propertyType) {
this.propertyType = propertyType;
}
@Override
public void build(Resource resource) throws PersistenceException {
super.build(resource);
ResourceResolver resolver = resource.getResourceResolver();
Resource propDefNode = resolver.getResource(resource, this.nodeName);
ModifiableValueMap vm = (ModifiableValueMap)propDefNode.adaptTo(ModifiableValueMap.class);
vm.put((Object)"ordered", (Object)this.ordered);
vm.put((Object)"type", (Object)this.propertyType);
}
}