jaxws/src/share/classes/com/sun/codemodel/internal/JBreak.java
changeset 8 474761f14bca
child 2678 57cf2a1c1a05
equal deleted inserted replaced
0:fd16c54261b3 8:474761f14bca
       
     1 /*
       
     2  * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.  Sun designates this
       
     8  * particular file as subject to the "Classpath" exception as provided
       
     9  * by Sun in the LICENSE file that accompanied this code.
       
    10  *
       
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14  * version 2 for more details (a copy is included in the LICENSE file that
       
    15  * accompanied this code).
       
    16  *
       
    17  * You should have received a copy of the GNU General Public License version
       
    18  * 2 along with this work; if not, write to the Free Software Foundation,
       
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20  *
       
    21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
       
    23  * have any questions.
       
    24  */
       
    25 
       
    26 package com.sun.codemodel.internal;
       
    27 
       
    28 
       
    29 /**
       
    30  * JBreak statement
       
    31  */
       
    32 final class JBreak implements JStatement {
       
    33 
       
    34     private final JLabel label;
       
    35 
       
    36     /**
       
    37      * JBreak constructor
       
    38      *
       
    39      * @param   _label
       
    40      *      break label or null.
       
    41      */
       
    42     JBreak( JLabel _label ) {
       
    43         this.label = _label;
       
    44     }
       
    45 
       
    46     public void state(JFormatter f) {
       
    47         if( label==null )
       
    48             f.p("break;").nl();
       
    49         else
       
    50             f.p("break").p(label.label).p(';').nl();
       
    51     }
       
    52 }