public String pathAsText(String name) { if (pathType == Type.JUST_NAME) { return name; } return fullPathAsText(name); }
protected String buildFullName(BuilderContext context) { return context.path().fullPathAsText(name); }
public boolean match(ContentPath path, String name, String dynamicType) { if (pathMatch != null && !patternMatch(pathMatch, path.fullPathAsText(name))) { return false; } if (match != null && !patternMatch(match, name)) { return false; } if (pathUnmatch != null && patternMatch(pathUnmatch, path.fullPathAsText(name))) { return false; } if (unmatch != null && patternMatch(unmatch, name)) { return false; } if (matchMappingType != null) { if (dynamicType == null) { return false; } if (!patternMatch(matchMappingType, dynamicType)) { return false; } } return true; }
@Override public Y build(BuilderContext context) { ContentPath.Type origPathType = context.path().pathType(); context.path().pathType(pathType); context.path().add(name); Map<String, Mapper> mappers = new HashMap<>(); for (Mapper.Builder builder : mappersBuilders) { Mapper mapper = builder.build(context); mappers.put(mapper.simpleName(), mapper); } context.path().pathType(origPathType); context.path().remove(); ObjectMapper objectMapper = createMapper(name, context.path().fullPathAsText(name), enabled, nested, dynamic, pathType, mappers, context.indexSettings()); objectMapper = objectMapper.includeInAllIfNotSet(includeInAll); return (Y) objectMapper; }
return null; final String path = context.path().fullPathAsText(currentFieldName); final Mapper.BuilderContext builderContext = new Mapper.BuilderContext(context.indexSettings(), context.path()); final MappedFieldType existingFieldType = context.mapperService().fullName(path);
ObjectMapper parent = context.root(); for (int i = 0; i < paths.length-1; i++) { mapper = context.docMapper().objectMappers().get(context.path().fullPathAsText(paths[i])); if (mapper == null) { mapper = (ObjectMapper) builder.build(builderContext); if (mapper.nested() != ObjectMapper.Nested.NO) { throw new MapperParsingException("It is forbidden to create dynamic nested objects ([" + context.path().fullPathAsText(paths[i]) + "]) through `copy_to`");