Package com.dtrules.automapping.nodes

Examples of com.dtrules.automapping.nodes.MapNodeObject


   
    @Override
    public void update(AutoDataMap autoDataMap, MapNodeAttribute node) {
        if(node.getParent() instanceof MapNodeObject){
            MapNodeObject parentNode = (MapNodeObject)node.getParent();
            Object        tgtObj     = parentNode.getTargetObject();
            if(tgtObj == null) return;
            IREntity      entity     = (IREntity) tgtObj;
            RName         attribute  = RName.getRName(node.getAttribute().getName());
            REntityEntry  entry      = entity.getEntry(attribute);
            if(entry != null && entry.writable){
View Full Code Here


     * @param label
     * @param key
     */
    public void pushLabel(String label, Object key){
        Label labelObj = Label.newLabel(currentGroup,label,label,label+"Id",null);
        MapNodeObject mno = new MapNodeObject(currentGroup, labelObj, getParent());
        mno.setKey(key);
        IMapNode parent = getParent();
        if(parent == null){
            dataMap.add(mno);
        }
        mapNodeStack.push(mno);
View Full Code Here

     */
    @SuppressWarnings("unchecked")
  public void setList(String listname, List list, String subtype){
      try {
      MapType       mapType   = MapType.get(subtype);
      MapNodeObject parent    = (MapNodeObject) getParent();
      Label         labelObj  = parent.getSourceLabel();
     
      IAttribute a = labelObj.getAttribute(listname);
   
      if(a == null){
          a = JavaAttribute.newAttribute(
View Full Code Here

    @SuppressWarnings("unchecked")
  private void loadObjects(IMapNode parent,  Group groupObj, Label labelObj, Object object){
       
      IDataSource dataSrc   = groupObj.getDataSource();
       
      MapNodeObject node = new MapNodeObject(groupObj, labelObj, parent);
        node.setSource(object);
       
        node.setKey(dataSrc.getKeyValue(node,object));
       
        if(parent==null){
            getDataMap().add(node);
        }
       
        // If we have written this object already, then we don't need to repeat its
        // attributes.  But we do need the key from the previous write!
        if(written.get(object)!=null){
            node.setKey(written.get(object).getKey());
        }else{
            written.put(object,node);
            for(IAttribute a : labelObj.getAttributes()){
                Object r = a.get(object);
                if(a.getType().isPrimitive()){
                    MapNodeAttribute mna = new MapNodeAttribute(a, node);
                    mna.setData(r);
                    if(a.isKey()){
                        node.setKey(r);
                    }
                }else{
                    if(a.getType() == MapType.LIST
                            && a.getSubType().isPrimitive()){
                        MapNodeList mnl = new MapNodeList(a, node);
View Full Code Here

   
    @Override
    public void update(AutoDataMap autoDataMap, MapNodeAttribute node) {
        if(node.getParent() instanceof MapNodeObject){
            MapNodeObject parentNode = (MapNodeObject)node.getParent();
            Object        tgtObj     = parentNode.getTargetObject();
            if(tgtObj == null) return;
            IREntity      entity     = (IREntity) tgtObj;
            RName         attribute  = RName.getRName(node.getAttribute().getName());
            REntityEntry  entry      = entity.getEntry(attribute);
            if(entry != null && entry.writable){
View Full Code Here

     * @param label
     * @param key
     */
    public void pushLabel(String label, Object key){
        Label labelObj = Label.newLabel(currentGroup,label,label,label+"Id",null);
        MapNodeObject mno = new MapNodeObject(currentGroup, labelObj, getParent());
        mno.setKey(key);
        IMapNode parent = getParent();
        if(parent == null){
            dataMap.add(mno);
        }
        mapNodeStack.push(mno);
View Full Code Here

     * @param subtype
     */
  public void setList(String listname, List<Object> list, String subtype){
      try {
      MapType       mapType   = MapType.get(subtype);
      MapNodeObject parent    = (MapNodeObject) getParent();
      Label         labelObj  = parent.getSourceLabel();
     
      IAttribute a = labelObj.getAttribute(listname);
   
      if(a == null){
          a = JavaAttribute.newAttribute(
View Full Code Here

    @SuppressWarnings("unchecked")
  private void loadObjects(IMapNode parent,  Group groupObj, Label labelObj, Object object){
       
      IDataSource dataSrc   = groupObj.getDataSource();
       
      MapNodeObject node = new MapNodeObject(groupObj, labelObj, parent);
        node.setSource(object);
       
        node.setKey(dataSrc.getKeyValue(node,object));
       
        if(parent==null){
            getDataMap().add(node);
        }
       
        // If we have written this object already, then we don't need to repeat its
        // attributes.  But we do need the key from the previous write!
        if(written.get(object)!=null){
            node.setKey(written.get(object).getKey());
        }else{
            written.put(object,node);
            for(IAttribute a : labelObj.getAttributes()){
                Object r = a.get(object);
                if(a.getType().isPrimitive()){
                    MapNodeAttribute mna = new MapNodeAttribute(a, node);
                    mna.setData(r);
                    if(a.isKey()){
                        node.setKey(r);
                    }
                }else{
                    if(a.getType() == MapType.LIST
                            && a.getSubType().isPrimitive()){
                        MapNodeList mnl = new MapNodeList(a, node);
View Full Code Here

   
    @Override
    public void update(AutoDataMap autoDataMap, MapNodeAttribute node) {
        if(node.getParent() instanceof MapNodeObject){
            MapNodeObject parentNode = (MapNodeObject)node.getParent();
            Object        tgtObj     = parentNode.getTargetObject();
            if(tgtObj == null) return;
            IREntity      entity     = (IREntity) tgtObj;
            RName         attribute  = RName.getRName(node.getAttribute().getName());
            REntityEntry  entry      = entity.getEntry(attribute);
            if(entry != null && entry.writable){
View Full Code Here

TOP

Related Classes of com.dtrules.automapping.nodes.MapNodeObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.