protected ElementImpl(ElementImpl parent) {
if (parent == null) throw new IllegalArgumentException("null ctx");
if (parent == this) {
throw new IllegalArgumentException("An element cannot be its own parent");
}
JElement check = parent.getParent();
while(check != null) {
if (check == this) throw new IllegalArgumentException("cycle detected");
check = check.getParent();
};
mContext = parent.getContext();
mParent = parent;
}