public static Formdef scan ( AfpInputStream in ) throws IOException { Formdef formdef = new FormdefImpl ( ) ; SF sf ; LinkedList < SF > sfbuffer = null ; while ( ( sf = in . readStructuredField ( ) ) != null ) { log . trace ( "{}" , sf ) ; switch ( sf . eClass ( ) . getClassifierID ( ) ) { case AfplibPackage . ERG : case AfplibPackage . BDT : return null ; case AfplibPackage . EFM : return formdef ; case AfplibPackage . BDG : sfbuffer = new LinkedList < SF > ( ) ; break ; case AfplibPackage . EDG : sfbuffer . add ( sf ) ; formdef . setBDG ( ( SF [ ] ) sfbuffer . toArray ( new SF [ sfbuffer . size ( ) ] ) ) ; sfbuffer = null ; break ; case AfplibPackage . BMM : sfbuffer = new LinkedList < SF > ( ) ; break ; case AfplibPackage . EMM : sfbuffer . add ( sf ) ; formdef . add ( ( SF [ ] ) sfbuffer . toArray ( new SF [ sfbuffer . size ( ) ] ) ) ; sfbuffer = null ; break ; } if ( sfbuffer != null ) sfbuffer . add ( sf ) ; } return null ; }
Scans the input for medium maps and adds to the formdef .