Examples of CObject


Examples of org.constretto.model.CObject

  @SuppressWarnings("unchecked")
  @Test
  public void simpleMapConversion() {
    final Map<String, CValue> map = new HashMap<String, CValue>();
    map.put("hei", new CPrimitive("hallo"));
    final Map<String,String> convertedMap = (Map<String,String>) ValueConverterRegistry.convert(String.class, String.class, new CObject(map));

    Assert.assertNotNull(convertedMap);
    Assert.assertTrue(convertedMap.size() == 1);
  }
View Full Code Here

Examples of org.constretto.model.CObject

    @Test
  public void mapListConversion() {
    final List<CValue> list = new ArrayList<CValue>();
    final Map<String, CValue> data = new HashMap<String, CValue>();
    data.put("key", new CPrimitive("value"));
    list.add(new CObject(data));

    final List<Map<String, String>> convertedList = (List<Map<String, String>>) ValueConverterRegistry.convert(String.class,
        String.class, new CArray(list));

    Assert.assertNotNull(convertedList);
View Full Code Here

Examples of org.constretto.model.CObject

    @Test(expected = ConstrettoException.class)
    public void testConvertUnsopportedClassConversion() {
    final Map<String, CValue> map = new HashMap<String, CValue>();
    map.put("hei", new CPrimitive("hallo"));
    ValueConverterRegistry.convert(getClass(), getClass(), new CObject(map));
    }
View Full Code Here

Examples of org.openehr.am.archetype.constraintmodel.CObject

        System.out.println("function: getDefinition : ");
       
        CComplexObject definition = a.getDefinition();
        List<CAttribute> attributesList = definition.getAttributes();
        CObject tmp = (CObject)definition;
        //System.out.println("RmAttributes:");
        for (CAttribute attribute : attributesList) {
            //String rmAttributeName = attribute.getRmAttributeName();
            ContainerPanel newPanel = null;
            newPanel = new ContainerPanel(a.getOntology());
View Full Code Here

Examples of org.openehr.am.archetype.constraintmodel.CObject

        // items asi nikdy nebude z triedy CMultipleAttribute
        //if( parent.getRmAttributeName().equalsIgnoreCase("items") )
        {
       
            String parentPath = parent.path();
            CObject node = archetype.node(parentPath);
            debugText(parentPath);
            if( node instanceof CComplexObject){
                debugText("CComplexObject");
            }
            debugText("children size: "+children.size());
            String parentClassName = parent.getClass().getSimpleName();
            System.out.println("attribute class name: "+parentClassName);//+" - "+node.getRmTypeName()+"\n");

            debugText("rmAttributeName: "+parent.getRmAttributeName());
            CAttribute.Existence existence;
            existence = parent.getExistence();
            debugText("existence: "+existence);
            //debugText(parent.childNodePathBase());
            debugText("isAnyAllowed: "+parent.isAnyAllowed());
            debugText("isNotAllowed: "+parent.isNotAllowed());
            debugText("isRequired: "+parent.isRequired());

            if (node != null) {
                debugText("node class name: " + node.getClass().getSimpleName());
                debugText("nodeID: "+node.getNodeID());
                debugText("node rmTypeName: "+node.getRmTypeName());
                debugText("occurences: "+node.getOccurrences());
                debugText("li: "+node.getOccurrences().isLowerIncluded());
                debugText("lu: "+node.getOccurrences().isLowerUnbounded());
                debugText("l: "+node.getOccurrences().getLower());
                debugText("ui: "+node.getOccurrences().isUpperIncluded());
                debugText("uu: "+node.getOccurrences().isUpperUnbounded());
                debugText("u: "+node.getOccurrences().getUpper());
                //debugText(": "+node.);
                nodes_count++;
                nodes.add(node);
            }

            debugText("parentNodePath: "+parent.parentNodePath());
            CObject parentNode = archetype.node(parent.parentNodePath());
            if( parentNode != null ){
                debugText("parent nodeId: "+parentNode.getNodeID());
                if( parentNode.getNodeID() != null ){
                    debugText("term text: "+archetypeOntology.termDefinition("en", parentNode.getNodeID()).getText());
                } else {
                    debugText("term text: ");
                }               
            }
           
View Full Code Here

Examples of org.openehr.am.archetype.constraintmodel.CObject

        ArchetypeOntology archetypeOntology = a.getOntology();
       
        for (CObject node : nodes) {
            debugText(node.path());
            CObject parent = null;
            //String termString = archetypeOntology.termDefinition("en", node.getNodeID()).getText();
        }

    }
View Full Code Here

Examples of org.openehr.am.archetype.constraintmodel.CObject

        Set<String> paths = a.physicalPaths();

        System.out.println("paths size: " + paths.size());

        CObject node = null;
        String rmTypeName = null;
        ArchetypeOntology archetypeOntology = a.getOntology();
        ArchetypeTerm termDefinition = null;
        String termDefinitionString = null;
       
        int i = 0;
        for (String path : paths) {
            node = a.node(path);
            rmTypeName = node.getRmTypeName();
            if (node != null) {
//                if(    !rmTypeName.equalsIgnoreCase("ELEMENT")
//                    && !rmTypeName.equalsIgnoreCase("ITEM_TREE")
//                    && !rmTypeName.equalsIgnoreCase("EVENT")
//                    && !rmTypeName.equalsIgnoreCase("HISTORY")
//                    && !rmTypeName.equalsIgnoreCase("OBSERVATION")
//                    && !rmTypeName.equalsIgnoreCase("DV_CODED_TEXT")
//                   )
                {
                    termDefinition = archetypeOntology.termDefinition("en", node.getNodeID());
                    if(termDefinition != null){
                        termDefinitionString = termDefinition.getText();
                        i++;
                        debugText(termDefinitionString+"\n"+rmTypeName+" \t- "+node.getClass().getSimpleName() + " \t- " + path);
                    } else {
                        termDefinitionString = "...";
                    }
                   
                }
View Full Code Here

Examples of org.openehr.am.archetype.constraintmodel.CObject

        //this.setPreferredSize(new Dimension(100, 30));
        //this.setMaximumSize(new Dimension(500, 30));
        this.setVisible(true);
       
        CAttribute attribute = parentPanel.getcAttribute();
        CObject object = parentPanel.getCobject();
        this.add(new JLabel(object.getClass().getSimpleName()));
       
        CComplexObject complexObject = (CComplexObject)object;
        List<CAttribute> attributes = complexObject.getAttributes();
       
        for(CAttribute cAttribute : attributes){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.