#**### no explicit constructor is created by default
#**##if ( $class.hasKeyInStereotypes('GWTClassTable'))
#*   *### compute set of classes in surrounding package
#*   *##set ( $package = $class.getDeclaredInPackage() )
#*   *#	// retrieve all class names
#*   *#	public void registerModelRoot ()
#*   *#	{
#*   *#		CClass cclass;
#*   *#		CAttribute cattr;
#*   *#		CAssoc cassoc;
#*   *#		CMethod cmeth;
#*   *#
#*   *##set( $return = $imports.addToImports("de.uni_kassel.webcoobra.client.ModelRoot") )		
#*   *#		ModelRoot.get().addEventListener(this);
#*   *#
#*   *##set ( $cobjectclass = $class.getSuperClass() )
#*   *##foreach ( $gwtClass in $cobjectclass.iteratorOfSubClasses() )
#*      *#
#*      *##parse("$lang/GWT/classDiag/class/classstructure.vm")
#*      *#
#*   *##end
#*   *#
#*   *#		/***********************************
#*   *#		Add CAssocs, CRoles and CCardinality
#*   *#		***********************************/
#*   *#		CRole crole = null;
#*   *#		CRole rightRole = null;
#*   *#		Iterator iter = null;
#*   *#		CCardinality ccardinality = null;
#*   *#		int upperBound = -1;
#*   *#		CClass tClass = null;
#*   *##foreach ( $theClass in $cobjectclass.iteratorOfSubClasses() )
#*      *#	#parse("$lang/GWT/classDiag/class/classassociation.vm")
#*   *##end ## for classes
#*   *#
#*   *#	}
#*   *#
#*   *##set ( $firstClass = true )
#*   *#   // gwt class table for the creation of objects from class names
#*   *#   public ICObject createObject(String classname)
#*   *#   {
#*   *##set ( $cobjectclass = $class.getSuperClass() )
#*   *##parse("$lang/GWT/classDiag/class/createObject.vm")
#*   *#      return null;
#*   *#   }
#**##end
#**##if ( !$interface )
#*   *#
#*   *#   public void removeAllFrom(String className) 
#*   *#   {
#*   *##set( $firstAttr = true )
#*   *##foreach( $role in $class.iteratorOfRoles() )
#*      *##if ( $role.Adornment != 3 )
#*         *##set ( $partnerRole = $role.getPartnerRole() )
#*         *##set( $toMany = ( $partnerRole.Card.UpperBound > 1 ) ) 
#*         *##if ( $toMany )
#*            *##set ( $accessor = "addTo$utility.upFirstChar($partnerRole.name)" )
#*            *##set ( $valueExpr = "($partnerRole.Target.FullClassName) value" )
#*            *##if ( ! $firstAttr )
#*               *#      else##
#*            *##end
#*            *##set ( $firstAttr = false )
#*            *#      if ("$partnerRole.Target.FullClassName".equals(className)){				
#*            *#         removeAllFrom$utility.upFirstChar($partnerRole.name)();
#*            *#      }
#*         *##end
#*      *##end## Adornment
#*   *##end## foreach
#*   *#   }
#*   *#   
#*   *#   /**
#*   *#   Return ArrayList of all atrr names
#*   *#   */
#*   *#   public java.util.ArrayList arrayListOfAttrNames() 
#*   *#   {
#*   *#      java.util.ArrayList vec = new java.util.ArrayList();
#*   *##foreach( $attr in $class.iteratorOfAllAttrs() )
#*      *#      vec.add("$attr.getName()");
#*   *##end
#*   *#   	
#*   *#      return vec;
#*   *#   }
#*   *#
#*   *###************************************************************************************************************************
#*   *##if( $utility.isDerivedfrom($class,"fujaba.web.runtime.client.ICObject") )
#*      *#   public Object invoke(CMethod method, ArrayList parameters){
#*      *#      return this.invoke(method.getName(),parameters);
#*      *#   }
#*      *#
#*      *#   public Object invoke(String method, ArrayList parameters){
#*      *##set( $firstMeth = true )
#*      *##foreach( $m in $class.iteratorOfMethods() )
#*         *##if(! $firstMeth)
#*            *#else ##
#*         *##else
#*         *#      ##
#*            *##set( $firstMeth = false )
#*         *##end
#*         *#if( method.equals( "$m.getFullMethodName()" )){
#*            *##set( $firstParam = true )
#*            *##set( $i = 0 )
#*            *#         ##
#*            *##if($m.getResultType().getName() != "Void")
#*               *#return ##
#*            *##end
#*            *##if($m.getResultType().getName() == "constructor")
#*               *# new ##
#*            *##end
#*            *#$utility.getMethodName($m.getFullMethodName())(##
#*            *##foreach( $p in $m.iteratorOfParam() )
#*               *##if(! $firstParam)
#*                  *#, ##
#*               *##else
#*                  *##set( $firstParam = false )
#*               *##end
#*               *#($p.getParamType().getName()) parameters.get($i)##
#*               *##set( $i = $i + 1 )
#*            *##end
#*            *#);
#*         *#      }##
#*      *##end
#*      *#
#*      *#      return null;
#*      *#   }
#*      *#
#*   *##end
#*   *#   // generic set and get methods
#*   *#   public void set (String fieldName, Object value)
#*   *#   {
#*   *### add an if for each attr
#*   *##set( $firstAttr = true )
#*   *##foreach( $attr in $class.iteratorOfAllAttrs() )
#*      *##if ($attr.AttrType == "Integer")
#*         *##set ( $valueExpr = "Integer.parseInt((String) value)" )
#*      *##elseif ($attr.AttrType == "Byte")
#*         *##set ( $valueExpr = "Byte.parseByte((String) value)" )
#*      *##elseif ($attr.AttrType == "Float")
#*         *##set ( $valueExpr = "Float.parseFloat((String) value)" )
#*      *##elseif ($attr.AttrType == "Double")
#*         *##set ( $valueExpr = "Double.parseDouble((String) value)" )
#*      *##elseif ($attr.AttrType == "Boolean")
#*         *##set ( $valueExpr = '"true".equals(value)' )
#*      *##elseif ($attr.AttrType == "Character")
#*         *##set ( $valueExpr = "value != null && value.length() != 0 ? value.toCharArray()[0] : null" )
#*      *##elseif ($attr.AttrType == "ShortInteger")
#*         *##set ( $valueExpr = "Short.parseShort((String) value)" )
#*      *##elseif ($attr.AttrType == "LongInteger")
#*         *##set ( $valueExpr = "Long.parseLong((String) value)" )
#*      *##else
#*         *##set ( $valueExpr = "($attr.AttrType) value" )
#*      *##end
#*      *##if ( ! $attr.isStatic())
#*         *##if ( ! $firstAttr )
#*            *#      else##
#*         *##end
#*         *##set ( $firstAttr = false )
#*         *#      // $attr.name
#*         *#      if ("$attr.name".equals(fieldName)){				
#*         *#         set$utility.upFirstChar($attr.name)($valueExpr);
#*         *#      }##
#*      *##end
#*   *##end##foreach
#*   *###
#*   *###
#*   *### and now the roles
#*   *###
#*   *##foreach( $role in $class.iteratorOfRoles() )
#*      *##if ( $role.Adornment != 3 )
#*         *##set ( $partnerRole = $role.getPartnerRole() )
#*         *##parse("${style}classDiag/assoc/roleProperties.vm")
#*         *##set( $toMany2 = $toMany )
#*         *##set( $toMany = ( $partnerRole.Card.UpperBound > 1 ) )
#*         *#//( toMany $toMany || toMany2 $toMany2 || qualified $qualified || 
#*         *#// internalQualified $internalQualified ||  
#*         *#// role.Qualifier $role.Qualifier || ordered $ordered || sorted $sorted)
#*         *##if ( $toMany || $role.Qualifier )
#*            *##set ( $accessor = "addTo$utility.upFirstChar($partnerRole.name)" )
#*         *##else
#*            *##set ( $accessor = "set$utility.upFirstChar($partnerRole.name)" )
#*         *##end
#*         *##if(  ( $toMany || !$toMany2) && !( $toMany && $toMany2)  && $role.Qualifier  )
#*            *#//1[ ( ( toMany || !toMany2) && !( toMany && $toMany2)  && role.Qualifier  ) ]
#*            *##if(  $qualified && !$internalQualified )##qualifiedToManyRight2
#*               *#//1.1 [ ( qualified && !internalQualified ) ]
#*               *##set ( $valueExpr = "((Map.Entry<String,Map.Entry>) value).getKey(),((Map.Entry<String,Map.Entry>) value).getValue()" )
#*            *##else
#*               *#//1.2 [! (qualified && !internalQualified ) ]
#*               *##set ( $valueExpr = "(Map.Entry) value" )
#*            *##end ##if(  $qualified  ) ##qualifiedToManyRight2
#*         *##else ##if(  $toMany && $role.Qualifier  )
#*            *#//2[! (  ( toMany || !toMany2) && !( toMany && toMany2)  && role.Qualifier  ) ]
#*            *##if(  $qualified && !$internalQualified )
#*               *#//2.1[ ( qualified && !internalQualified ) ]
#*               *##if( $role.Qualifier )
#*                  *#//2.1.1[ ( role.Qualifier ) ]
#*                  *##set ( $valueExpr = "((Map.Entry<String,Map.Entry>) value).getKey(),((Map.Entry<String,Map.Entry>) value).getValue()" )
#*               *##else
#*                  *#//2.1.2[ !( role.Qualifier ) ]
#*                  *##set ( $valueExpr = "((Map.Entry<String,$partnerRole.Target.FullClassName>) value).getKey(),((Map.Entry<String,$partnerRole.Target.FullClassName>) value).getValue()" )
#*               *##end
#*            *##else
#*               *#//2.2[ !( qualified && !internalQualified ) ]
#*               *##set ( $valueExpr = "($partnerRole.Target.FullClassName) value" )
#*            *##end ##if(  $qualified && !$internalQualified )
#*         *##end
#*         *##if ( ! $firstAttr )
#*            *#else##
#*         *##end
#*         *##set ( $firstAttr = false )
#*         *#// $partnerRole.name
#*         *#      if ("$partnerRole.name".equals(fieldName)){				
#*         *#         $accessor ($valueExpr);
#*         *#      }##
#*      *##end## Adornment
#*   *##end## foreach
#*   *#   } ##public void set (String fieldName, Object value)
#*   *# 
#*   *#
#*   *#   public void add (String fieldName, Object value)
#*   *#   {
#*   *#      set (fieldName, value);
#*   *#   }
#*   *###
#*   *### and now getter
#*   *###
#*   *#
#*   *#   public Object get (String fieldName)
#*   *#   {
#*   *##set( $firstAttr = true )
#*   *##foreach( $attr in $class.iteratorOfAllAttrs() )
#*      *##set( $methodPrefix = "get" )
#*      *##if ( "Boolean" == $attr.AttrType )
#*         *##set( $methodPrefix = "is" )
#*      *##end
#*      *##if ( ! $attr.isStatic())
#*         *##if ( ! $firstAttr )
#*            *#      else##
#*         *##end
#*         *##set ( $firstAttr = false )
#*         *#      // $attr.name
#*         *#      if ("$attr.name".equals(fieldName)){
#*         *##set ( $javatype = "$attr.AttrType" )
#*         *##if ($attr.AttrType == "LongInteger")
#*            *##set ( $javatype = "Long" )
#*         *##end
#*         *#         return ($javatype) $methodPrefix$utility.upFirstChar($attr.name)();
#*         *#      }
#*      *##end
#*   *##end##foreach
#*   *### and now the roles
#*   *##foreach( $role in $class.iteratorOfRoles() )
#*      *##if ( $role.Adornment != 3 )
#*         *##set ( $partnerRole = $role.getPartnerRole() )
#*         *##parse("${style}classDiag/assoc/roleProperties.vm")
#*         *##set( $toMany = ( $partnerRole.Card.UpperBound > 1 ) ) 
#*         *##if ( $toMany ||  $role.Qualifier)
#*            *##set ( $accessor = "iteratorOf$utility.upFirstChar($partnerRole.name)()" )
#*         *##else
#*            *##set ( $accessor = "get$utility.upFirstChar($partnerRole.name)()" )
#*         *##end
#*         *##set ( $valueExpr = "($partnerRole.Target.FullClassName) value" )
#*         *##if ( ! $firstAttr )
#*            *#      else##
#*         *##end
#*         *##set ( $firstAttr = false )
#*         *#      if ("$partnerRole.name".equals(fieldName))
#*         *#      {				
#*         *#         return $accessor;
#*         *#      }
#*      *##end## Adornment
#*   *##end## foreach role
#*   *#      return null;
#*   *#   }
#**##end