@Override public Property get(String name) throws PropertyNotFoundException { Field field = getType().getField(name); if (field == null) { return computeRemovedProperty(name); } return getChild(field); }
protected boolean compatibleTypes(Type targetType, Type sourceType) { if (!sourceType.getName().equals(targetType.getName())) { return false; } if (sourceType.isComplexType()) { for (Field field : ((ComplexType) sourceType).getFields()) { Field targetField = ((ComplexType) targetType).getField(field.getName()); if (targetField == null || !field.getType().equals(targetField.getType())) { return false; } } } if (sourceType.isListType()) { if (!((ListType) sourceType).getFieldType().equals(((ListType) targetType).getFieldType())) { return false; } if (((ListType) sourceType).getFieldType().isComplexType()) { return compatibleTypes(((ListType) targetType).getFieldType(), ((ListType) sourceType).getFieldType()); } } return true; } }
continue; clonedMap.put(k, cloneField(ctype.getField(k), k, v));
protected final void readComplex(Element element, ComplexType ctype, Map map, boolean inlineBlobs) throws IOException { Iterator<Map.Entry> it = map.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = it.next(); readProperty(element, ctype.getNamespace(), ctype.getField(entry.getKey().toString()), entry.getValue(), inlineBlobs); } }
private void fillComplexProperty(Property property, JsonNode jn) throws IOException { Entry<String, JsonNode> elNode; Iterator<Entry<String, JsonNode>> it = jn.fields(); ComplexProperty complexProperty = (ComplexProperty) property; ComplexType type = complexProperty.getType(); while (it.hasNext()) { elNode = it.next(); String elName = elNode.getKey(); Field field = type.getField(elName); if (field != null) { Property child = readProperty(property, field, elNode.getValue()); property.setValue(elName, child.getValue()); } } }
protected Field resolveSubField(ListType listType, String subName, boolean fallbackOnSubElement) { Type itemType = listType.getFieldType(); if (itemType.isComplexType() && subName != null) { ComplexType complexType = (ComplexType) itemType; Field subField = complexType.getField(subName); return subField; } if (fallbackOnSubElement) { return listType.getField(); } return null; }
if (ct.hasField(nodeEntry.getKey())) { Field field = ct.getField(nodeEntry.getKey()); Type fieldType = field.getType(); if (fieldType.isSimpleType()) {
field = fieldComplexType.getField(t); parts.add(t); continue;
Map<String, Set<String>> propPathsByIndex; if (baseType instanceof ComplexType && TypeConstants.isContentType(baseType)) { baseType = ((ComplexType) baseType).getField(BaseDocument.BLOB_DATA).getType(); // BinaryType
protected Field getField(Field parent, String subFieldName, boolean finalCall) { if (parent != null) { Type type = parent.getType(); if (type.isListType()) { ListType listType = (ListType) type; // remove indexes in case of multiple values if ("*".equals(subFieldName)) { if (!finalCall) { return parent; } else { return resolveSubField(listType, null, true); } } try { Integer.valueOf(subFieldName); if (!finalCall) { return parent; } else { return resolveSubField(listType, null, true); } } catch (NumberFormatException e) { return resolveSubField(listType, subFieldName, false); } } else if (type.isComplexType()) { return ((ComplexType) type).getField(subFieldName); } } return null; }
Element el = it.next(); String name = el.getName(); Object value = getElementData(xdoc, el, ctype.getField(el.getName()).getType()); map.put(name, value);
String name = el.getName(); Object value = getElementData(xdoc, el, ctype.getField(el.getName()).getType()); map.put(name, value);
if (!firstPart) { field = ((ComplexType) type).getField(part); if (field == null) { throw new QueryParseException("No such property: " + name);
for (int i = 0; i < segments.length; i++) { String segment = segments[i]; Field field = parentType.getField(segment); if (field == null && i == 0) {
for (int i = 0; i < segments.length; i++) { String segment = segments[i]; Field field = parentType.getField(segment); if (field == null && i == 0) {