Package com.dtrules.automapping

Examples of com.dtrules.automapping.Label


        LabelMap labelMap = autoDataMapDef.findLabelMap(node.getLabel());
        while(labelMap != null && labelMap.getTargetGroup() != autoDataMap.getCurrentGroup()){
            labelMap = labelMap.getNext();
        }
        if(labelMap == null){
            Label sourceLabel = node.getSourceLabel();
            String targetLabelname = node.getLabel();
            Label.newLabel(
                    autoDataMap.getCurrentGroup(),
                    targetLabelname,
                    targetLabelname,
                    sourceLabel.getKey(),
                    false);
            labelMap = new LabelMap(autoDataMapDef, node.getLabel(), targetLabelname);
            labelMap.setSourceGroup(node.getGroup());
            labelMap.setTargetGroup(autoDataMap.getCurrentGroup());
           
View Full Code Here


     * We map the given object to the target context.  If no labelMap yet exists
     * for this mapping, we create one.
     */
    @Override
    public Object mapObject(AutoDataMap autoDataMap, LabelMap labelMap, MapNodeObject node) {       
       Label target = autoDataMap.getCurrentGroup().findLabel(labelMap.getTarget());
       IREntity entity = findEntity(autoDataMap, target.getSpec(),target, node.getKey());  
       node.setTargetObject(entity);
       return entity;
    }
View Full Code Here

            Object object) {
        if (key == null || key.trim().length()==0) key = "";
        if (labelName == null || labelName.trim().length()== 0){
            throw new RuntimeException("A Label has to have a valid Label Name.");
        }
        Label labelObj = group.findLabel(labelName,"java",object.getClass().getName());
        if(labelObj == null ){
            labelObj = Label.newLabel(group,labelName,object.getClass().getName(),key,singular);
        }
       
        if(labelObj.isCached()== false){
            cacheGetters(group, labelObj,object);
            labelObj.setCached(true);
        }
        return labelObj;
    }
View Full Code Here

            for(Method method : methods){
                String name = getterName(method);
                if(name!= null){
                    Class subType = getSubType(method);
                    if(subType!=null){
                        Label label;
                       
                        if(subType.isPrimitive()){
                            label = group.findLabelBySpec(method.getName());
                        }else{
                            label = group.findLabelBySpec(subType.getName());
                        }
                       
                        if(label!=null && group.isPruned(label.getSpec())){
                            continue;
                        }
                    }
                    try{
                      Method setter     = null;
View Full Code Here

       
        Node xmlnode = (Node)object;
       
        if(!xmlnode.getAttributes().containsKey("node"))return null;
       
        Label labelObj = group.findLabel(labelName,"xml",labelName);
       
        if(labelObj == null ){
            labelObj = Label.newLabel(group,labelName,labelName,key,singular);
        }
        if(labelObj.isCached())return labelObj;
        labelObj.setCached(true);
       
        for(Node xmltag : xmlnode.getTags()){
            String node    = xmltag.getAttributes().get("node");
            String type    = xmltag.getAttributes().get("type");
            String subType = xmltag.getAttributes().get("subType");
            // First check if this is just a tag wrapping the dataload file.  If so,
            // just claim it is a List.
            if(type==null){
                node    = "object";
                type    = "list";
                subType = "object";
            }
            if(node.equals("primitive")){
                type    = xmltag.getName();
                subType = "";
               
            }
           
            IAttribute a = new XMLAttribute(
                    xmltag.getName(),
                    labelObj,
                    type, subType,
                    xmltag.getAttributes());
           
            labelObj.getAttributes().add(a);
        }
        return labelObj;
    }
View Full Code Here

        LabelMap labelMap = autoDataMapDef.findLabelMap(node.getLabel());
        while(labelMap != null && labelMap.getTargetGroup() != autoDataMap.getCurrentGroup()){
            labelMap = labelMap.getNext();
        }
        if(labelMap == null){
            Label sourceLabel = node.getSourceLabel();
            String targetLabelname = node.getLabel();
            Label.newLabel(
                    autoDataMap.getCurrentGroup(),
                    targetLabelname,
                    targetLabelname,
                    sourceLabel.getKey(),
                    false);
            labelMap = new LabelMap(autoDataMapDef, node.getLabel(), targetLabelname);
            labelMap.setSourceGroup(node.getGroup());
            labelMap.setTargetGroup(autoDataMap.getCurrentGroup());
           
View Full Code Here

     * We map the given object to the target context.  If no labelMap yet exists
     * for this mapping, we create one.
     */
    @Override
    public Object mapObject(AutoDataMap autoDataMap, LabelMap labelMap, MapNodeObject node) {       
       Label target = autoDataMap.getCurrentGroup().findLabel(labelMap.getTarget());
       IREntity entity = findEntity(autoDataMap, target.getSpec(),target, node.getKey());  
       node.setTargetObject(entity);
       return entity;
    }
View Full Code Here

       
        Node xmlnode = (Node)object;
       
        if(!xmlnode.getAttributes().containsKey("node"))return null;
       
        Label labelObj = group.findLabel(labelName,"xml",labelName);
       
        if(labelObj == null ){
            labelObj = Label.newLabel(group,labelName,labelName,key,singular);
        }
        if(labelObj.isCached())return labelObj;
        labelObj.setCached(true);
       
        for(Node xmltag : xmlnode.getTags()){
            String node    = xmltag.getAttributes().get("node");
            String type    = xmltag.getAttributes().get("type");
            String subType = xmltag.getAttributes().get("subType");
            // First check if this is just a tag wrapping the dataload file.  If so,
            // just claim it is a List.
            if(type==null){
                node    = "object";
                type    = "list";
                subType = "object";
            }
            if(node.equals("primitive")){
                type    = xmltag.getName();
                subType = "";
               
            }
           
            IAttribute a = new XMLAttribute(
                    xmltag.getName(),
                    labelObj,
                    type, subType,
                    xmltag.getAttributes());
           
            labelObj.getAttributes().add(a);
        }
        return labelObj;
    }
View Full Code Here

            Object object) {
        if (key == null || key.trim().length()==0) key = "";
        if (labelName == null || labelName.trim().length()== 0){
            throw new RuntimeException("A Label has to have a valid Label Name.");
        }
        Label labelObj = group.findLabel(labelName,"java",object.getClass().getName());
        if(labelObj == null ){
            labelObj = Label.newLabel(group,labelName,object.getClass().getName(),key,singular);
        }
       
        if(labelObj.isCached()== false){
            cacheGetters(group, labelObj,object);
            labelObj.setCached(true);
        }
        return labelObj;
    }
View Full Code Here

            for(Method method : methods){
                String name = getterName(method);
                if(name!= null){
                    Class<?> subType = getSubType(method);
                    if(subType!=null){
                        Label label;
                       
                        if(subType.isPrimitive()){
                            label = group.findLabelBySpec(method.getName());
                        }else{
                            label = group.findLabelBySpec(subType.getName());
                        }
                       
                        if(label!=null && group.isPruned(label.getSpec())){
                            continue;
                        }
                    }
                    try{
                      Method setter     = null;
View Full Code Here

TOP

Related Classes of com.dtrules.automapping.Label

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.