public void setName(String name) { if (name == bean.getName()) return; if (name != null && name.equals(bean.getName())) return; ensureUpdateable(bean); bean.setName(name); }
public void setDescription(String description) { if (description == bean.getDescription()) return; if (description != null && description.equals(bean.getDescription())) return; ensureUpdateable(bean); bean.setDescription(description); }
public Product createProduct() { ObjexObj newProduct = getInternalContainer().newObject(this, bean, "Product"); ensureUpdateable(bean); List<String> prods = bean.getProducts(); if (prods == null) prods = new ArrayList<String>(); prods.add(newProduct.getId().toString()); bean.setProducts(prods); return newProduct.getBehaviour(Product.class); }
public Category createCategory() { ObjexObj newCat = getInternalContainer().newObject(this, bean, "Category"); ensureUpdateable(bean); List<String> cats = bean.getCategories(); if (cats == null) cats = new ArrayList<String>(); cats.add(newCat.getId().toString()); bean.setCategories(cats); return newCat.getBehaviour(Category.class); }
public void acceptReader(ObjexStateReader reader) { String name = bean.getName(); String newName = reader.read("name", name, java.lang.String.class, ObjexFieldType.OBJECT, true); if (name != newName) setName(newName); String description = bean.getDescription(); String newDescription = reader.read( "description", description, java.lang.String.class, ObjexFieldType.OBJECT, true); if (description != newDescription) setDescription(newDescription); List<String> products = bean.getProducts(); List<String> newProducts = reader.readReferenceList("products", products, ObjexFieldType.OWNED_REFERENCE, true); if (products != newProducts) setProducts(newProducts); List<String> categories = bean.getCategories(); List<String> newCategories = reader.readReferenceList("categories", categories, ObjexFieldType.OWNED_REFERENCE, true); if (categories != newCategories) setCategories(newCategories); }
@XmlAttribute public String getDescription() { return bean.getDescription(); }
@XmlAttribute public String getName() { return bean.getName(); }
public void setProducts(List<String> products) { ensureUpdateable(bean); bean.setProducts(products); }
@XmlElement(type = ProductImpl.class) public List<Product> getProducts() { return getContainer().getObjectList(bean.getProducts(), Product.class); }
public List<String> getProductRefs() { return bean.getProducts(); }
public void setCategories(List<String> categories) { ensureUpdateable(bean); bean.setCategories(categories); }
@XmlElement(type = XmlObjexObj.class) public List<Category> getCategories() { return getContainer().getObjectList(bean.getCategories(), Category.class); }
public List<String> getCategoryRefs() { return bean.getCategories(); }