Package commonj.sdo.helper

Examples of commonj.sdo.helper.TypeHelper.define()


    quotesProperty.set("name", "quotes");
    quotesProperty.set("type", mixedQuoteType);
    quotesProperty.set("many", Boolean.TRUE);
    quotesProperty.set("containment", Boolean.TRUE);
   
    types.define(mixedQuoteType);
   
    DataObject quote = factory.create("http://www.example.com/mixed", "MixedQuote");

    assertTrue(quote.getType().isSequenced());
   
View Full Code Here


    quotesProperty.set("name", "quotes");
    quotesProperty.set("type", mixedQuoteType);
    quotesProperty.set("many", Boolean.TRUE);
    quotesProperty.set("containment", Boolean.TRUE);
   
    types.define(mixedQuoteType);
   
    // Define a global type
    DataObject globalType = factory.create("commonj.sdo", "Type");
    globalType.set("uri", "http://www.example.com/open");
    // Don't set the type's name - null is used for types containing global properties.
View Full Code Here

    DataObject symbolProperty = globalType.createDataObject("property");
    symbolProperty.set("name", "symbol");
    symbolProperty.set("type", stringType);
    symbolProperty.set("containment", Boolean.TRUE);
   
    types.define(globalType);
   
    DataObject quote = factory.create("http://www.example.com/mixed", "MixedOpenQuote");

    assertTrue(quote.getType().isSequenced());
   
View Full Code Here

    openQuoteType.set("uri", "http://www.example.com/open");
    openQuoteType.set("name", "OpenQuote");
    openQuoteType.set("open", Boolean.TRUE);
    openQuoteType.setBoolean("open", true);

    types.define(openQuoteType);
   
    // Define new type - CompanyType
    DataObject companyType = factory.create("commonj.sdo", "Type");
    companyType.set("uri", "http://www.example.com/open");
    companyType.set("name", "CompanyType");
View Full Code Here

    nameProperty.set("name", "name");
    nameProperty.set("type", stringType);
    nameProperty.set("containment", Boolean.TRUE);
    nameProperty.setBoolean(xmlElementProp, false);
   
    types.define(companyType);
   
    // Define open content property - company
    DataObject symbolProperty = factory.create("commonj.sdo", "Property");
    symbolProperty.set("name", "symbol");
    symbolProperty.set("type", stringType);
View Full Code Here

       
        aProperty = quoteType.createDataObject("property");
        aProperty.set("name", "referredQuotes");
        aProperty.set("type", typeHelper.getType(quoteSDO.getType().getURI(), quoteSDO.getType().getName()));
       
        typeHelper.define(quoteType);
       
        Type dynamicQuoteType =
            typeHelper.getType("http://www.example.com/dynamic", "DynamicQuote");
        Vector types = new Vector();
        types.add(dynamicQuoteType);
View Full Code Here

        specifyProperty(containerTypeDO, "aString", thDO.getType(COMMONJ_SDO, "String"), true);
        specifyProperty(containerTypeDO, "aBoolean", thDO.getType(COMMONJ_SDO, "Boolean"), true);
        specifyProperty(containerTypeDO, "aFloat", thDO.getType(COMMONJ_SDO, "Float"), true);

        Type containerType = thDO.define(containerTypeDO);
        assertNotNull(containerType);

        DataObject doFromApiAndDynTyp = dfDO.create(containerType);
        assertNotNull(doFromApiAndDynTyp);
        doFromApiAndDynTyp.getList("aString").add("This is a repeated string.");
View Full Code Here

    typeDeclarations.add(testType);
    addPropertyDescription(testType, pSet, "referrals");
    addPropertyDescription(testType, pSet, "patients");
    addPropertyDescription(testType, pSet, "relatives");

    List types = typeHelper.define(typeDeclarations);

    DataObject p = scope.getDataFactory().create("commonj.sdo", "Property");
    p.set("type", typeHelper.getType(medicalURI, "Condition"));
    p.set("name", "condition");
    p.setBoolean("many", true);
View Full Code Here

    typeDeclarations.add(testType);
    addPropertyDescription(testType, pSet, "referrals");
    addPropertyDescription(testType, pSet, "patients");
    addPropertyDescription(testType, pSet, "relatives");

    List types = typeHelper.define(typeDeclarations);

    DataObject p = scope.getDataFactory().create("commonj.sdo", "Property");
    p.set("type", typeHelper.getType(medicalURI, "Condition"));
    p.set("name", "condition");
    p.setBoolean("many", true);
View Full Code Here

     
      commentary("Now that our type is fully modeled we submit the model to the TypeHelper\n"+
          "The new Type instance is returned to us,  but is also available for lookup within\n"+
          "the scope associated with the TypeHelper\n\n"+
          "Type t = typeHelper.define(customerType);");
      Type t = typeHelper.define(customerType);
     
      commentary("Here we see the newly created Type being accessed via the TypeHelper\n"+
          "along with a printout of the Type's Properties\n\n"+
          "Type testType = scope.getTypeHelper().getType(\"http://example.com/customer\", \"Customer\");");
     
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.