1 23 24 package org.objectweb.medor.query.lib; 25 26 import org.objectweb.medor.api.Field; 27 import org.objectweb.medor.api.MedorException; 28 import org.objectweb.medor.lib.BasicMultivaluedField; 29 import org.objectweb.medor.query.api.NestedField; 30 import org.objectweb.medor.query.api.QueryTree; 31 32 import java.util.Map ; 33 34 38 public class BasicNestedField extends BasicMultivaluedField 39 implements NestedField { 40 41 protected QueryTree qt; 42 43 public BasicNestedField() { 44 } 45 46 public BasicNestedField(String name, QueryTree qt, 47 Field[] nestedFields) throws MedorException { 48 super(name, nestedFields); 49 this.qt = qt; 50 } 51 public Object clone(Object clone, 52 Map obj2clone) throws CloneNotSupportedException { 53 clone = super.clone(clone, obj2clone); 54 ((BasicNestedField) clone).qt = qt; 55 return clone; 56 } 57 58 public QueryTree getQueryTree() { 59 return qt; 60 } 61 62 public void replacePreviousField(Field[] neo) { 63 name2field.clear(); 64 for (int i = 0; i < neo.length; i++) { 65 name2field.put(neo[i].getName(), neo[i]); 66 } 67 } 68 } 69 | Popular Tags |