/**
 * @license
 * Copyright 2017 The FOAM Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

foam.CLASS({
  package: 'foam.java',
  name: 'Method',

  properties: [
    'name',
    { class: 'String', name: 'visibility' },
    'static',
    'final',
    'type',
    'synchronized',
    {
      class: 'FObjectArray',
      of: 'foam.java.Argument',
      name: 'args'
    },
    { class: 'StringArray', name: 'throws' },
    { class: 'foam.java.CodeProperty', name: 'body' }
  ],

  methods: [
    function outputJava(o) {
      o.indent();
      o.out(this.visibility, this.visibility ? ' ' : '',
        this.static ? 'static ' : '',
        this.final ? 'final ' : '',
        this.synchronized ? 'synchronized ' : '',
        this.type ? this.type + ' ' : '',
        this.name, '(');

      for ( var i = 0 ; this.args && i < this.args.length ; i++ ) {
        o.out(this.args[i]);
        if ( i != this.args.length - 1 ) o.out(', ');
      }

      o.out(')');

      if ( this.throws.length > 0 ) {
        o.out(" throws ");
        for ( var i = 0 ; i < this.throws.length ; i++ ) {
          o.out(this.throws[i]);
          if ( i < this.throws.length - 1 ) o.out(", ");
        }
      }

      o.out(' {\n');

      o.increaseIndent();
      o.out(this.body);
      o.decreaseIndent();
      o.indent();
      o.out('}');
    }
  ]
});

@@ -772,16 +772,32 @@
 tatic',%0A
+    'abstract',%0A
     'fin
@@ -1162,22 +1162,74 @@
    this.
-static
+abstract     ? 'abstract ' : '',%0A        this.static      
  ? 'stat
@@ -1258,16 +1258,23 @@
 s.final 
+       
 ? 'final
@@ -1350,16 +1350,24 @@
 is.type 
+        
 ? this.t
@@ -1812,32 +1812,98 @@
      %7D%0A      %7D%0A%0A
+      if ( this.abstract ) %7B%0A        o.out(';');%0A      %7D else %7B%0A  
       o.out(' %7B%5C
@@ -1904,24 +1904,26 @@
 t(' %7B%5Cn');%0A%0A
+  
       o.incr
@@ -1934,32 +1934,34 @@
 Indent();%0A      
+ 
+ 
 o.out(this.body)
@@ -1962,16 +1962,18 @@
 .body);%0A
+  
       o.
@@ -1982,32 +1982,34 @@
 creaseIndent();%0A
+  
       o.indent()
@@ -2012,24 +2012,26 @@
 nt();%0A      
+  
 o.out('%7D');%0A
@@ -2026,24 +2026,32 @@
 o.out('%7D');%0A
+      %7D%0A
     %7D%0A  %5D%0A%7D)

Add abstract support to Java Method.