Package org.dmd.mvw.tools.mvwgenerator.types

Examples of org.dmd.mvw.tools.mvwgenerator.types.MethodWithArgs


   
    @Override
    // org.dmd.dms.util.GenUtility.dumpMVType(GenUtility.java:2363)
    public MethodWithArgs add(Object v) throws DmcValueException {
        synchronized(this){
            MethodWithArgs rc = typeCheck(v);
            if (value == null)
                value = new ArrayList<MethodWithArgs>();
            value.add(rc);
            return(rc);
        }
View Full Code Here


    public MethodWithArgs del(Object v){
        synchronized(this){
            if (value == null)
                return(null);
   
            MethodWithArgs key = null;
            MethodWithArgs rc = null;
            try {
                key = typeCheck(v);
            } catch (DmcValueException e) {
                throw(new IllegalStateException("Incompatible type passed to del():" + getName(),e));
            }
View Full Code Here

                throw(new IllegalStateException("Attribute: " + getAttributeInfo().name + " is not indexed. You can't use setMVnth()."));
           
            if ( (index < 0) || (index >= getAttributeInfo().indexSize))
                throw(new IllegalStateException("Index " + index + " for attribute: " + getAttributeInfo().name + " is out of range: 0 <= index < " + getAttributeInfo().indexSize));
           
            MethodWithArgs rc = null;
           
            if (v != null)
                rc = typeCheck(v);
           
            if (value == null){
View Full Code Here

        synchronized(this){
            if (value == null)
                return(false);

            try {
                MethodWithArgs val = typeCheck(v);
                return(value.contains(val));
            } catch (DmcValueException e) {
                return(false);
            }
        }
View Full Code Here

    }
   
    @Override
    // org.dmd.dms.util.GenUtility.dumpSVType(GenUtility.java:2010)
    public MethodWithArgs set(Object v) throws DmcValueException {
        MethodWithArgs rc = typeCheck(v);
        // We only return a value if the value actually changed. This supports
        // the applyModifier() mechanism on DmcObject where we only return true
        // if something changed as a result of the modifier
        if (value == null)
            value = rc;
View Full Code Here

public class MethodWithArgsTest {

  @Test
  public void testOK1() throws DmcValueException{
    MethodWithArgs mwa = null;
   
    mwa = new MethodWithArgs("void contactChanged(ContactDMO dmo) Called with the user hits Apply");
   
    assertEquals("Return type should be void","void",mwa.getReturnType());
   
    assertEquals("Comment should be 'Called with the user hits Apply'","Called with the user hits Apply",mwa.getComment());
   
//    try {
//      mwa = new MethodWithArgs("contact");
//    } catch (DmcValueException e1) {
//      System.out.println(e1);
View Full Code Here

   
    @Override
    // org.dmd.dms.util.GenUtility.dumpSETType(GenUtility.java:2659)
    public MethodWithArgs add(Object v) throws DmcValueException {
        synchronized(this){
            MethodWithArgs rc = typeCheck(v);
            if (value == null)
                initValue();
       
            // If false is returned, we didn't modify the set, so return null
            if (!value.add(rc))
View Full Code Here

   
    @Override
    // org.dmd.dms.util.GenUtility.dumpSETType(GenUtility.java:2676)
    public MethodWithArgs del(Object v){
        synchronized(this){
            MethodWithArgs rc = null;
            if (value == null)
                return(rc);
           
            try {
                rc = typeCheck(v);
View Full Code Here

        synchronized(this){
            if (value == null)
                return(false);
           
            try {
                MethodWithArgs val = typeCheck(v);
                return(value.contains(val));
            } catch (DmcValueException e) {
                return(false);
            }
        }
View Full Code Here

public class GetWithModsTest {

  @Test
  public void testStringConstructor(){
    MethodWithArgs mwa = null;
   
    try {
      mwa = new MethodWithArgs("functionName");
      assertTrue("Should have indicated that the argument vector was missing.", false);
    } catch (DmcValueException e1) {
      assertTrue("Expected exception", true);
    }
   
    try {
      mwa = new MethodWithArgs("functionName(");
      assertTrue("Should have indicated that the argument vector was missing.", false);
    } catch (DmcValueException e1) {
      assertTrue("Expected exception", true);
    }
   
    try {
      mwa = new MethodWithArgs("functionName()");
      assertTrue("Should have indicated that the return type was missing.", false);
    } catch (DmcValueException e1) {
      System.out.println("Expected:\n" + e1);
      assertTrue("Expected exception", true);
    }
   
    try {
      mwa = new MethodWithArgs("setContact(Contact contact)");
      assertTrue("Should have indicated that the return type was missing.", false);
    } catch (DmcValueException e1) {
      System.out.println("Expected:\n" + e1);
      assertTrue("Expected exception", true);
    }
   
    try {
      mwa = new MethodWithArgs("void ()");
      assertTrue("Should have indicated that the method name was missing.", false);
    } catch (DmcValueException e1) {
      assertTrue("Expected exception", true);
    }
   
    try {
      mwa = new MethodWithArgs("void            ()");
      assertTrue("Should have indicated that the method name was missing.", false);
    } catch (DmcValueException e1) {
      assertTrue("Expected exception", true);
    }
   
    try {
      mwa = new MethodWithArgs("void functionName()");
      assertTrue("Empty argvector is ok.", true);
    } catch (DmcValueException e1) {
      System.out.println(e1);
      assertTrue("Unexpected exception", false);
    }
   
    try {
      mwa = new MethodWithArgs("void setContact(Contact contact)      We set the contact to be displayed");
      System.out.println(mwa);
      assertTrue("Empty argvector is ok.", true);
    } catch (DmcValueException e1) {
      System.out.println(e1);
      assertTrue("Unexpected exception", false);
View Full Code Here

TOP

Related Classes of org.dmd.mvw.tools.mvwgenerator.types.MethodWithArgs

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.