/** @deprecated use contentStruct instead */ @Deprecated // TODO: Remove on Vespa 8 public StructDataType getHeaderType() { return contentStruct(); }
public SDDocumentType setStruct(DataType structType) { if (structType != null) { this.structType = structType; inheritedTypes.clear(); } else { if (docType.contentStruct() != null) { this.structType = docType.contentStruct(); inheritedTypes.clear(); } else { throw new IllegalArgumentException("You can not set a null struct"); } } return this; }
@SuppressWarnings("deprecation") private void setNewType(DocumentType type) { header = type.contentStruct().createFieldValue(); body = type.getBodyType().createFieldValue(); }
private static StructDataType handleStruct(NewDocumentType dt, SDDocumentType type) { StructDataType s = new StructDataType(type.getName()); for (Field f : type.getDocumentType().contentStruct().getFieldsThisTypeOnly()) { specialHandleAnnotationReference(dt, f); s.addField(f); } for (StructDataType inherited : type.getDocumentType().contentStruct().getInheritedTypes()) { s.inherit(inherited); } extractNestedTypes(dt, s); addType(dt, s); return s; }
/** * Creates a new document type. * The document type id will be generated as a hash from the document type name. * * @param name The name of the new document type * @param search check for type ID collisions in this search definition */ @SuppressWarnings("deprecation") public SDDocumentType(String name, Search search) { docType = new DocumentType(name); docType.contentStruct().setCompressionConfig(new CompressionConfig()); docType.getBodyType().setCompressionConfig(new CompressionConfig()); validateId(search); inherit(VESPA_DOCUMENT); }
document.getDocumentType().contentStruct().setCompressionConfig(cfg);
Map<StructDataType, String> structInheritance = new HashMap<>(); NewDocumentType dt = new NewDocumentType(new NewDocumentType.Name(sdoc.getName()), sdoc.getDocumentType().contentStruct(), sdoc.getDocumentType().getBodyType(), sdoc.getFieldSets(), handleStruct(dt, sdoc.getDocumentType().contentStruct()); handleStruct(dt, sdoc.getDocumentType().getBodyType());
doc. name(dt.getName()). headerstruct(dt.contentStruct().getId()). bodystruct(dt.getBodyType().getId()); for (DocumentType inherited : dt.getInheritedTypes()) {