@@ -94,7 +94,7 @@ private void addRestriction(ValueFactory valueFactory, Map<String, Value> result
94
94
if (REP_GLOB_PROPERTY .equals (key )) {
95
95
result .put (key , normalizeGlob (valueFactory ));
96
96
} else {
97
- result .put (key , valueFactory .createValue (value , PropertyType . NAME ));
97
+ result .put (key , valueFactory .createValue (value , determinePropertyType ( key ) ));
98
98
}
99
99
}
100
100
}
@@ -126,18 +126,26 @@ public Map<String, Value[]> getMultiValueRestrictions(ValueFactory valueFactory)
126
126
127
127
private void addRestrictions (ValueFactory valueFactory , Map <String , Value []> result , String key , List <String > names ) throws ValueFormatException {
128
128
if (names != null && !names .isEmpty ()) {
129
- result .put (key , createRestrictions (valueFactory , names ));
129
+ result .put (key , createRestrictions (valueFactory , names , determinePropertyType ( key ) ));
130
130
}
131
131
}
132
132
133
- private Value [] createRestrictions (ValueFactory valueFactory , List <String > names ) throws ValueFormatException {
133
+ private Value [] createRestrictions (ValueFactory valueFactory , List <String > names , int propertyType ) throws ValueFormatException {
134
134
Value [] values = new Value [names .size ()];
135
135
for (int index = 0 ; index < names .size (); index ++) {
136
- values [index ] = valueFactory .createValue (names .get (index ), PropertyType . NAME );
136
+ values [index ] = valueFactory .createValue (names .get (index ), propertyType );
137
137
}
138
138
return values ;
139
139
}
140
140
141
+ private int determinePropertyType (String key ) {
142
+ if (StringUtils .equalsAny (key , REP_NT_NAMES_PROPERTY , REP_ITEM_NAMES_PROPERTY )) {
143
+ return PropertyType .NAME ;
144
+ } else {
145
+ return PropertyType .STRING ;
146
+ }
147
+ }
148
+
141
149
private boolean isMultivalue (Map .Entry <String , Object > entry ) {
142
150
boolean result ;
143
151
if (REP_GLOB_PROPERTY .equals (entry .getKey ())) {
0 commit comments