Initial load

This commit is contained in:
J. Duke 2007-12-01 00:00:00 +00:00
parent 686d76f772
commit f57b87e8f6
2973 changed files with 295817 additions and 0 deletions

View file

@ -0,0 +1,48 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for an annotation.
*
* For example:
* <pre>
* {@code @}<em>annotationType</em>
* {@code @}<em>annotationType</em> ( <em>arguments</em> )
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 9.7"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface AnnotationTree extends ExpressionTree {
Tree getAnnotationType();
List<? extends ExpressionTree> getArguments();
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an array access expression.
*
* For example:
* <pre>
* <em>expression</em> [ <em>index</em> ]
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.13"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ArrayAccessTree extends ExpressionTree {
ExpressionTree getExpression();
ExpressionTree getIndex();
}

View file

@ -0,0 +1,44 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an array type.
*
* For example:
* <pre>
* <em>type</em> []
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 10.1"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ArrayTypeTree extends Tree {
Tree getType();
}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an 'assert' statement.
*
* For example:
* <pre>
* assert <em>condition</em> ;
*
* assert <em>condition</em> : <em>detail</em> ;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.10"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface AssertTree extends StatementTree {
ExpressionTree getCondition();
ExpressionTree getDetail();
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an assignment expression.
*
* For example:
* <pre>
* <em>variable</em> = <em>expression</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.26.1"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface AssignmentTree extends ExpressionTree {
ExpressionTree getVariable();
ExpressionTree getExpression();
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a binary expression.
* Use {@link #getKind getKind} to determine the kind of operator.
*
* For example:
* <pre>
* <em>leftOperand</em> <em>operator</em> <em>rightOperand</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, sections 15.17 to 15.24"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface BinaryTree extends ExpressionTree {
ExpressionTree getLeftOperand();
ExpressionTree getRightOperand();
}

View file

@ -0,0 +1,51 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for a statement block.
*
* For example:
* <pre>
* { }
*
* { <em>statements</em> }
*
* static { <em>statements</em> }
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.2"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface BlockTree extends StatementTree {
boolean isStatic();
List<? extends StatementTree> getStatements();
}

View file

@ -0,0 +1,48 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import javax.lang.model.element.Name;
/**
* A tree node for a 'break' statement.
*
* For example:
* <pre>
* break;
*
* break <em>label</em> ;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.15"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface BreakTree extends StatementTree {
Name getLabel();
}

View file

@ -0,0 +1,54 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for a 'case' in a 'switch' statement.
*
* For example:
* <pre>
* case <em>expression</em> :
* <em>statements</em>
*
* default :
* <em>statements</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.11"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface CaseTree extends Tree {
/**
* @return null if and only if this Case is {@code default:}
*/
ExpressionTree getExpression();
List<? extends StatementTree> getStatements();
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a 'catch' block in a 'try' statement.
*
* For example:
* <pre>
* catch ( <em>parameter</em> )
* <em>block</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.20"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface CatchTree extends Tree {
VariableTree getParameter();
BlockTree getBlock();
}

View file

@ -0,0 +1,59 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
import javax.lang.model.element.Name;
/**
* A tree node for a class, interface, enum, or annotation
* type declaration.
*
* For example:
* <pre>
* <em>modifiers</em> class <em>simpleName</em> <em>typeParameters</em>
* extends <em>extendsClause</em>
* implements <em>implementsClause</em>
* {
* <em>members</em>
* }
* </pre>
*
* @see "The Java Language Specification, 3rd ed,
* sections 8.1, 8.9, 9.1, and 9.6"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ClassTree extends StatementTree {
ModifiersTree getModifiers();
Name getSimpleName();
List<? extends TypeParameterTree> getTypeParameters();
Tree getExtendsClause();
List<? extends Tree> getImplementsClause();
List<? extends Tree> getMembers();
}

View file

@ -0,0 +1,54 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
import javax.tools.JavaFileObject;
import com.sun.source.tree.LineMap;
/**
* Represents the abstract syntax tree for compilation units (source
* files) and package declarations (package-info.java).
*
* @see "The Java Language Specification, 3rd ed, sections 7.3, and 7.4"
*
* @author Peter von der Ah&eacute;
* @since 1.6
*/
public interface CompilationUnitTree extends Tree {
List<? extends AnnotationTree> getPackageAnnotations();
ExpressionTree getPackageName();
List<? extends ImportTree> getImports();
List<? extends Tree> getTypeDecls();
JavaFileObject getSourceFile();
/**
* Gets the line map for this compilation unit, if available.
* Returns null if the line map is not available.
* @return the line map for this compilation unit
*/
LineMap getLineMap();
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for compound assignment operator.
* Use {@link #getKind getKind} to determine the kind of operator.
*
* For example:
* <pre>
* <em>variable</em> <em>operator</em> <em>expression</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.26.2"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface CompoundAssignmentTree extends ExpressionTree {
ExpressionTree getVariable();
ExpressionTree getExpression();
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for the conditional operator ? :.
*
* For example:
* <pre>
* <em>condition</em> ? <em>trueExpression</em> : <em>falseExpression</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.25"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ConditionalExpressionTree extends ExpressionTree {
ExpressionTree getCondition();
ExpressionTree getTrueExpression();
ExpressionTree getFalseExpression();
}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import javax.lang.model.element.Name;
/**
* A tree node for a 'continue' statement.
*
* For example:
* <pre>
* continue;
* continue <em>label</em> ;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.16"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ContinueTree extends StatementTree {
Name getLabel();
}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a 'do' statement.
*
* For example:
* <pre>
* do
* <em>statement</em>
* while ( <em>expression</em> );
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.13"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface DoWhileLoopTree extends StatementTree {
ExpressionTree getCondition();
StatementTree getStatement();
}

View file

@ -0,0 +1,42 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an empty (skip) statement.
*
* For example:
* <pre>
* ;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.6"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface EmptyStatementTree extends StatementTree {}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an "enhanced" 'for' loop statement.
*
* For example:
* <pre>
* for ( <em>variable</em> : <em>expression</em> )
* <em>statement</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.14.2"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface EnhancedForLoopTree extends StatementTree {
VariableTree getVariable();
ExpressionTree getExpression();
StatementTree getStatement();
}

View file

@ -0,0 +1,39 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node to stand in for a malformed expression.
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ErroneousTree extends ExpressionTree {
List<? extends Tree> getErrorTrees();
}

View file

@ -0,0 +1,44 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an expression statement.
*
* For example:
* <pre>
* <em>expression</em> ;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.8"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ExpressionStatementTree extends StatementTree {
ExpressionTree getExpression();
}

View file

@ -0,0 +1,38 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node used as the base class for the different types of
* expressions.
*
* @see "The Java Language Specification, 3rd ed, chapter 15"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ExpressionTree extends Tree {}

View file

@ -0,0 +1,50 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for a basic 'for' loop statement.
*
* For example:
* <pre>
* for ( <em>initializer</em> ; <em>condition</em> ; <em>update</em> )
* <em>statement</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.14.1"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ForLoopTree extends StatementTree {
List<? extends StatementTree> getInitializer();
ExpressionTree getCondition();
List<? extends ExpressionStatementTree> getUpdate();
StatementTree getStatement();
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import javax.lang.model.element.Name;
/**
* A tree node for an identifier expression.
*
* For example:
* <pre>
* <em>name</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 6.5.6.1"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface IdentifierTree extends ExpressionTree {
Name getName();
}

View file

@ -0,0 +1,55 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an 'if' statement.
*
* For example:
* <pre>
* if ( <em>condition</em> )
* <em>thenStatement</em>
*
* if ( <em>condition</em> )
* <em>thenStatement</em>
* else
* <em>elseStatement</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.9"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface IfTree extends StatementTree {
ExpressionTree getCondition();
StatementTree getThenStatement();
/**
* @return null if this if statement has no else branch.
*/
StatementTree getElseStatement();
}

View file

@ -0,0 +1,51 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an import statement.
*
* For example:
* <pre>
* import <em>qualifiedIdentifier</em> ;
*
* static import <em>qualifiedIdentifier</em> ;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 7.5"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ImportTree extends Tree {
boolean isStatic();
/**
* @return a qualified identifier ending in "*" if and only if
* this is an import-on-demand.
*/
Tree getQualifiedIdentifier();
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for an 'instanceof' expression.
*
* For example:
* <pre>
* <em>expression</em> instanceof <em>type</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.20.2"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface InstanceOfTree extends ExpressionTree {
ExpressionTree getExpression();
Tree getType();
}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import javax.lang.model.element.Name;
/**
* A tree node for a labeled statement.
*
* For example:
* <pre>
* <em>label</em> : <em>statement</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.7"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface LabeledStatementTree extends StatementTree {
Name getLabel();
StatementTree getStatement();
}

View file

@ -0,0 +1,78 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* Provides methods to convert between character positions and line numbers
* for a compilation unit.
*
* @since 1.6
*/
public interface LineMap {
/**
* Find the start position of a line.
*
* @param line line number (beginning at 1)
* @return position of first character in line
* @throws IndexOutOfBoundsException
* if <tt>lineNumber < 1</tt>
* if <tt>lineNumber > no. of lines</tt>
*/
long getStartPosition(long line);
/**
* Find the position corresponding to a (line,column).
*
* @param line line number (beginning at 1)
* @param column tab-expanded column number (beginning 1)
*
* @return position of character
* @throws IndexOutOfBoundsException
* if {@code line < 1}
* if {@code line > no. of lines}
*/
long getPosition(long line, long column);
/**
* Find the line containing a position; a line termination
* character is on the line it terminates.
*
* @param pos character offset of the position
* @return the line number of pos (first line is 1)
*/
long getLineNumber(long pos);
/**
* Find the column for a character position.
* Tab characters preceding the position on the same line
* will be expanded when calculating the column number.
*
* @param pos character offset of the position
* @return the tab-expanded column number of pos (first column is 1)
*/
long getColumnNumber(long pos);
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a literal expression.
* Use {@link #getKind getKind} to determine the kind of literal.
*
* For example:
* <pre>
* <em>value</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.28"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface LiteralTree extends ExpressionTree {
Object getValue();
}

View file

@ -0,0 +1,48 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import javax.lang.model.element.Name;
/**
* A tree node for a member access expression.
*
* For example:
* <pre>
* <em>expression</em> . <em>identifier</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, sections 6.5,
* 15.11, and 15.12"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface MemberSelectTree extends ExpressionTree {
ExpressionTree getExpression();
Name getIdentifier();
}

View file

@ -0,0 +1,50 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for a method invocation expression.
*
* For example:
* <pre>
* <em>identifier</em> ( <em>arguments</em> )
*
* this . <em>typeArguments</em> <em>identifier</em> ( <em>arguments</em> )
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.12"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface MethodInvocationTree extends ExpressionTree {
List<? extends Tree> getTypeArguments();
ExpressionTree getMethodSelect();
List<? extends ExpressionTree> getArguments();
}

View file

@ -0,0 +1,59 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
import javax.lang.model.element.Name;
/**
* A tree node for a method or annotation type element declaration.
*
* For example:
* <pre>
* <em>modifiers</em> <em>typeParameters</em> <em>type</em> <em>name</em>
* ( <em>parameters</em> )
* <em>body</em>
*
* <em>modifiers</em> <em>type</em> <em>name</em> () default <em>defaultValue</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, sections 8.4, 8.6, 8.7,
* 9.4, and 9.6"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface MethodTree extends Tree {
ModifiersTree getModifiers();
Name getName();
Tree getReturnType();
List<? extends TypeParameterTree> getTypeParameters();
List<? extends VariableTree> getParameters();
List<? extends ExpressionTree> getThrows();
BlockTree getBody();
Tree getDefaultValue(); // for annotation types
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
import java.util.Set;
import javax.lang.model.element.Modifier;
/**
* A tree node for the modifiers, including annotations, for a declaration.
*
* For example:
* <pre>
* <em>flags</em>
*
* <em>flags</em> <em>annotations</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, sections
* 8.1.1, 8.3.1, 8.4.3, 8.5.1, 8.8.3, 9.1.1, and 9.7"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ModifiersTree extends Tree {
Set<Modifier> getFlags();
List<? extends AnnotationTree> getAnnotations();
}

View file

@ -0,0 +1,50 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for an expression to create a new instance of an array.
*
* For example:
* <pre>
* new <em>type</em> <em>dimensions</em> <em>initializers</em>
*
* new <em>type</em> <em>dimensions</em> [ ] <em>initializers</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.10"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface NewArrayTree extends ExpressionTree {
Tree getType();
List<? extends ExpressionTree> getDimensions();
List<? extends ExpressionTree> getInitializers();
}

View file

@ -0,0 +1,57 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node to declare a new instance of a class.
*
* For example:
* <pre>
* new <em>identifier</em> ( )
*
* new <em>identifier</em> ( <em>arguments</em> )
*
* new <em>typeArguments</em> <em>identifier</em> ( <em>arguments</em> )
* <em>classBody</em>
*
* <em>enclosingExpression</em>.new <em>identifier</em> ( <em>arguments</em> )
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.9"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface NewClassTree extends ExpressionTree {
ExpressionTree getEnclosingExpression();
List<? extends Tree> getTypeArguments();
ExpressionTree getIdentifier();
List<? extends ExpressionTree> getArguments();
ClassTree getClassBody();
}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for a type expression involving type parameters.
*
* For example:
* <pre>
* <em>type</em> &lt; <em>typeArguments</em> &gt;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 4.5.1"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ParameterizedTypeTree extends Tree {
Tree getType();
List<? extends Tree> getTypeArguments();
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a parenthesized expression. Note: parentheses
* not be preserved by the parser.
*
* For example:
* <pre>
* ( <em>expression</em> )
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.8.5"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ParenthesizedTree extends ExpressionTree {
ExpressionTree getExpression();
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import javax.lang.model.type.TypeKind;
/**
* A tree node for a primitive type.
*
* For example:
* <pre>
* <em>primitiveTypeKind</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 4.2"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface PrimitiveTypeTree extends Tree {
TypeKind getPrimitiveTypeKind();
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a 'return' statement.
*
* For example:
* <pre>
* return;
* return <em>expression</em>;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.17"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ReturnTree extends StatementTree {
ExpressionTree getExpression();
}

View file

@ -0,0 +1,73 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import com.sun.source.tree.Tree;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.DeclaredType;
/**
* Interface for determining locally available program elements, such as
* local variables and imports.
* Upon creation, a Scope is associated with a given program position;
* for example, a {@linkplain Tree tree node}. This position may be used to
* infer an enclosing method and/or class.
*
* <p>A Scope does not itself contain the details of the elements corresponding
* to the parameters, methods and fields of the methods and classes containing
* its position. However, these elements can be determined from the enclosing
* elements.
*
* <p>Scopes may be contained in an enclosing scope. The outermost scope contains
* those elements available via "star import" declarations; the scope within that
* contains the top level elements of the compilation unit, including any named
* imports.
*
* @since 1.6
*/
public interface Scope {
/**
* Returns the enclosing scope.
*/
public Scope getEnclosingScope();
/**
* Returns the innermost type element containing the position of this scope
*/
public TypeElement getEnclosingClass();
/**
* Returns the innermost executable element containing the position of this scope.
*/
public ExecutableElement getEnclosingMethod();
/**
* Returns the elements directly contained in this scope.
*/
public Iterable<? extends Element> getLocalElements();
}

View file

@ -0,0 +1,38 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node used as the base class for the different kinds of
* statements.
*
* @see "The Java Language Specification, 3rd ed, chapter 14"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface StatementTree extends Tree {}

View file

@ -0,0 +1,49 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for a 'switch' statement.
*
* For example:
* <pre>
* switch ( <em>expression</em> ) {
* <em>cases</em>
* }
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.11"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface SwitchTree extends StatementTree {
ExpressionTree getExpression();
List<? extends CaseTree> getCases();
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a 'synchronized' statement.
*
* For example:
* <pre>
* synchronized ( <em>expression</em> )
* </em>block</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.19"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface SynchronizedTree extends StatementTree {
ExpressionTree getExpression();
BlockTree getBlock();
}

View file

@ -0,0 +1,44 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a 'throw' statement.
*
* For example:
* <pre>
* throw <em>expression</em>;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.18"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface ThrowTree extends StatementTree {
ExpressionTree getExpression();
}

View file

@ -0,0 +1,585 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* Common interface for all nodes in an abstract syntax tree.
*
* <p><b>WARNING:</b> This interface and its sub-interfaces are
* subject to change as the Java&trade; programming language evolves.
* These interfaces are implemented by Sun's Java compiler (javac)
* and should not be implemented either directly or indirectly by
* other applications.
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
*
* @since 1.6
*/
public interface Tree {
/**
* Enumerates all kinds of trees.
*/
public enum Kind {
/**
* Used for instances of {@link AnnotationTree}.
*/
ANNOTATION(AnnotationTree.class),
/**
* Used for instances of {@link ArrayAccessTree}.
*/
ARRAY_ACCESS(ArrayAccessTree.class),
/**
* Used for instances of {@link ArrayTypeTree}.
*/
ARRAY_TYPE(ArrayTypeTree.class),
/**
* Used for instances of {@link AssertTree}.
*/
ASSERT(AssertTree.class),
/**
* Used for instances of {@link AssignmentTree}.
*/
ASSIGNMENT(AssignmentTree.class),
/**
* Used for instances of {@link BlockTree}.
*/
BLOCK(BlockTree.class),
/**
* Used for instances of {@link BreakTree}.
*/
BREAK(BreakTree.class),
/**
* Used for instances of {@link CaseTree}.
*/
CASE(CaseTree.class),
/**
* Used for instances of {@link CatchTree}.
*/
CATCH(CatchTree.class),
/**
* Used for instances of {@link ClassTree}.
*/
CLASS(ClassTree.class),
/**
* Used for instances of {@link CompilationUnitTree}.
*/
COMPILATION_UNIT(CompilationUnitTree.class),
/**
* Used for instances of {@link ConditionalExpressionTree}.
*/
CONDITIONAL_EXPRESSION(ConditionalExpressionTree.class),
/**
* Used for instances of {@link ContinueTree}.
*/
CONTINUE(ContinueTree.class),
/**
* Used for instances of {@link DoWhileLoopTree}.
*/
DO_WHILE_LOOP(DoWhileLoopTree.class),
/**
* Used for instances of {@link EnhancedForLoopTree}.
*/
ENHANCED_FOR_LOOP(EnhancedForLoopTree.class),
/**
* Used for instances of {@link ExpressionStatementTree}.
*/
EXPRESSION_STATEMENT(ExpressionStatementTree.class),
/**
* Used for instances of {@link MemberSelectTree}.
*/
MEMBER_SELECT(MemberSelectTree.class),
/**
* Used for instances of {@link ForLoopTree}.
*/
FOR_LOOP(ForLoopTree.class),
/**
* Used for instances of {@link IdentifierTree}.
*/
IDENTIFIER(IdentifierTree.class),
/**
* Used for instances of {@link IfTree}.
*/
IF(IfTree.class),
/**
* Used for instances of {@link ImportTree}.
*/
IMPORT(ImportTree.class),
/**
* Used for instances of {@link InstanceOfTree}.
*/
INSTANCE_OF(InstanceOfTree.class),
/**
* Used for instances of {@link LabeledStatementTree}.
*/
LABELED_STATEMENT(LabeledStatementTree.class),
/**
* Used for instances of {@link MethodTree}.
*/
METHOD(MethodTree.class),
/**
* Used for instances of {@link MethodInvocationTree}.
*/
METHOD_INVOCATION(MethodInvocationTree.class),
/**
* Used for instances of {@link ModifiersTree}.
*/
MODIFIERS(ModifiersTree.class),
/**
* Used for instances of {@link NewArrayTree}.
*/
NEW_ARRAY(NewArrayTree.class),
/**
* Used for instances of {@link NewClassTree}.
*/
NEW_CLASS(NewClassTree.class),
/**
* Used for instances of {@link ParenthesizedTree}.
*/
PARENTHESIZED(ParenthesizedTree.class),
/**
* Used for instances of {@link PrimitiveTypeTree}.
*/
PRIMITIVE_TYPE(PrimitiveTypeTree.class),
/**
* Used for instances of {@link ReturnTree}.
*/
RETURN(ReturnTree.class),
/**
* Used for instances of {@link EmptyStatementTree}.
*/
EMPTY_STATEMENT(EmptyStatementTree.class),
/**
* Used for instances of {@link SwitchTree}.
*/
SWITCH(SwitchTree.class),
/**
* Used for instances of {@link SynchronizedTree}.
*/
SYNCHRONIZED(SynchronizedTree.class),
/**
* Used for instances of {@link ThrowTree}.
*/
THROW(ThrowTree.class),
/**
* Used for instances of {@link TryTree}.
*/
TRY(TryTree.class),
/**
* Used for instances of {@link ParameterizedTypeTree}.
*/
PARAMETERIZED_TYPE(ParameterizedTypeTree.class),
/**
* Used for instances of {@link TypeCastTree}.
*/
TYPE_CAST(TypeCastTree.class),
/**
* Used for instances of {@link TypeParameterTree}.
*/
TYPE_PARAMETER(TypeParameterTree.class),
/**
* Used for instances of {@link VariableTree}.
*/
VARIABLE(VariableTree.class),
/**
* Used for instances of {@link WhileLoopTree}.
*/
WHILE_LOOP(WhileLoopTree.class),
/**
* Used for instances of {@link UnaryTree} representing postfix
* increment operator {@code ++}.
*/
POSTFIX_INCREMENT(UnaryTree.class),
/**
* Used for instances of {@link UnaryTree} representing postfix
* decrement operator {@code --}.
*/
POSTFIX_DECREMENT(UnaryTree.class),
/**
* Used for instances of {@link UnaryTree} representing prefix
* increment operator {@code ++}.
*/
PREFIX_INCREMENT(UnaryTree.class),
/**
* Used for instances of {@link UnaryTree} representing prefix
* decrement operator {@code --}.
*/
PREFIX_DECREMENT(UnaryTree.class),
/**
* Used for instances of {@link UnaryTree} representing unary plus
* operator {@code +}.
*/
UNARY_PLUS(UnaryTree.class),
/**
* Used for instances of {@link UnaryTree} representing unary minus
* operator {@code -}.
*/
UNARY_MINUS(UnaryTree.class),
/**
* Used for instances of {@link UnaryTree} representing bitwise
* complement operator {@code ~}.
*/
BITWISE_COMPLEMENT(UnaryTree.class),
/**
* Used for instances of {@link UnaryTree} representing logical
* complement operator {@code !}.
*/
LOGICAL_COMPLEMENT(UnaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* multiplication {@code *}.
*/
MULTIPLY(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* division {@code /}.
*/
DIVIDE(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* remainder {@code %}.
*/
REMAINDER(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* addition or string concatenation {@code +}.
*/
PLUS(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* subtraction {@code -}.
*/
MINUS(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* left shift {@code <<}.
*/
LEFT_SHIFT(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* right shift {@code >>}.
*/
RIGHT_SHIFT(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* unsigned right shift {@code >>>}.
*/
UNSIGNED_RIGHT_SHIFT(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* less-than {@code <}.
*/
LESS_THAN(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* greater-than {@code >}.
*/
GREATER_THAN(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* less-than-equal {@code <=}.
*/
LESS_THAN_EQUAL(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* greater-than-equal {@code >=}.
*/
GREATER_THAN_EQUAL(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* equal-to {@code ==}.
*/
EQUAL_TO(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* not-equal-to {@code !=}.
*/
NOT_EQUAL_TO(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* bitwise and logical "and" {@code &}.
*/
AND(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* bitwise and logical "xor" {@code ^}.
*/
XOR(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* bitwise and logical "or" {@code |}.
*/
OR(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* conditional-and {@code &&}.
*/
CONDITIONAL_AND(BinaryTree.class),
/**
* Used for instances of {@link BinaryTree} representing
* conditional-or {@code ||}.
*/
CONDITIONAL_OR(BinaryTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* multiplication assignment {@code *=}.
*/
MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* division assignment {@code /=}.
*/
DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* remainder assignment {@code %=}.
*/
REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* addition or string concatenation assignment {@code +=}.
*/
PLUS_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* subtraction assignment {@code -=}.
*/
MINUS_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* left shift assignment {@code <<=}.
*/
LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* right shift assignment {@code >>=}.
*/
RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* unsigned right shift assignment {@code >>>=}.
*/
UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* bitwise and logical "and" assignment {@code &=}.
*/
AND_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* bitwise and logical "xor" assignment {@code ^=}.
*/
XOR_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link CompoundAssignmentTree} representing
* bitwise and logical "or" assignment {@code |=}.
*/
OR_ASSIGNMENT(CompoundAssignmentTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* an integral literal expression of type {@code int}.
*/
INT_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* an integral literal expression of type {@code long}.
*/
LONG_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* a floating-point literal expression of type {@code float}.
*/
FLOAT_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* a floating-point literal expression of type {@code double}.
*/
DOUBLE_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* a boolean literal expression of type {@code boolean}.
*/
BOOLEAN_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* a character literal expression of type {@code char}.
*/
CHAR_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* a string literal expression of type {@link String}.
*/
STRING_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link LiteralTree} representing
* the use of {@code null}.
*/
NULL_LITERAL(LiteralTree.class),
/**
* Used for instances of {@link WildcardTree} representing
* an unbounded wildcard type argument.
*/
UNBOUNDED_WILDCARD(WildcardTree.class),
/**
* Used for instances of {@link WildcardTree} representing
* an extends bounded wildcard type argument.
*/
EXTENDS_WILDCARD(WildcardTree.class),
/**
* Used for instances of {@link WildcardTree} representing
* a super bounded wildcard type argument.
*/
SUPER_WILDCARD(WildcardTree.class),
/**
* Used for instances of {@link ErroneousTree}.
*/
ERRONEOUS(ErroneousTree.class),
/**
* An implementation-reserved node. This is the not the node
* you are looking for.
*/
OTHER(null);
Kind(Class<? extends Tree> intf) {
associatedInterface = intf;
}
public Class<? extends Tree> asInterface() {
return associatedInterface;
}
private final Class<? extends Tree> associatedInterface;
}
/**
* Gets the kind of this tree.
*
* @return the kind of this tree.
*/
Kind getKind();
/**
* Accept method used to implement the visitor pattern. The
* visitor pattern is used to implement operations on trees.
*
* @param <R> result type of this operation.
* @param <D> type of additonal data.
*/
<R,D> R accept(TreeVisitor<R,D> visitor, D data);
}

View file

@ -0,0 +1,108 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A visitor of trees, in the style of the visitor design pattern.
* Classes implementing this interface are used to operate
* on a tree when the kind of tree is unknown at compile time.
* When a visitor is passed to an tree's {@link Tree#accept
* accept} method, the <tt>visit<i>XYZ</i></tt> method most applicable
* to that tree is invoked.
*
* <p> Classes implementing this interface may or may not throw a
* {@code NullPointerException} if the additional parameter {@code p}
* is {@code null}; see documentation of the implementing class for
* details.
*
* <p> <b>WARNING:</b> It is possible that methods will be added to
* this interface to accommodate new, currently unknown, language
* structures added to future versions of the Java&trade; programming
* language. Therefore, visitor classes directly implementing this
* interface may be source incompatible with future versions of the
* platform.
*
* @param <R> the return type of this visitor's methods. Use {@link
* Void} for visitors that do not need to return results.
* @param <P> the type of the additional parameter to this visitor's
* methods. Use {@code Void} for visitors that do not need an
* additional parameter.
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
*
* @since 1.6
*/
public interface TreeVisitor<R,P> {
R visitAnnotation(AnnotationTree node, P p);
R visitMethodInvocation(MethodInvocationTree node, P p);
R visitAssert(AssertTree node, P p);
R visitAssignment(AssignmentTree node, P p);
R visitCompoundAssignment(CompoundAssignmentTree node, P p);
R visitBinary(BinaryTree node, P p);
R visitBlock(BlockTree node, P p);
R visitBreak(BreakTree node, P p);
R visitCase(CaseTree node, P p);
R visitCatch(CatchTree node, P p);
R visitClass(ClassTree node, P p);
R visitConditionalExpression(ConditionalExpressionTree node, P p);
R visitContinue(ContinueTree node, P p);
R visitDoWhileLoop(DoWhileLoopTree node, P p);
R visitErroneous(ErroneousTree node, P p);
R visitExpressionStatement(ExpressionStatementTree node, P p);
R visitEnhancedForLoop(EnhancedForLoopTree node, P p);
R visitForLoop(ForLoopTree node, P p);
R visitIdentifier(IdentifierTree node, P p);
R visitIf(IfTree node, P p);
R visitImport(ImportTree node, P p);
R visitArrayAccess(ArrayAccessTree node, P p);
R visitLabeledStatement(LabeledStatementTree node, P p);
R visitLiteral(LiteralTree node, P p);
R visitMethod(MethodTree node, P p);
R visitModifiers(ModifiersTree node, P p);
R visitNewArray(NewArrayTree node, P p);
R visitNewClass(NewClassTree node, P p);
R visitParenthesized(ParenthesizedTree node, P p);
R visitReturn(ReturnTree node, P p);
R visitMemberSelect(MemberSelectTree node, P p);
R visitEmptyStatement(EmptyStatementTree node, P p);
R visitSwitch(SwitchTree node, P p);
R visitSynchronized(SynchronizedTree node, P p);
R visitThrow(ThrowTree node, P p);
R visitCompilationUnit(CompilationUnitTree node, P p);
R visitTry(TryTree node, P p);
R visitParameterizedType(ParameterizedTypeTree node, P p);
R visitArrayType(ArrayTypeTree node, P p);
R visitTypeCast(TypeCastTree node, P p);
R visitPrimitiveType(PrimitiveTypeTree node, P p);
R visitTypeParameter(TypeParameterTree node, P p);
R visitInstanceOf(InstanceOfTree node, P p);
R visitUnary(UnaryTree node, P p);
R visitVariable(VariableTree node, P p);
R visitWhileLoop(WhileLoopTree node, P p);
R visitWildcard(WildcardTree node, P p);
R visitOther(Tree node, P p);
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
/**
* A tree node for a 'try' statement.
*
* For example:
* <pre>
* try
* <em>block</em>
* <em>catches</em>
* finally
* <em>finallyBlock</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 14.20"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface TryTree extends StatementTree {
BlockTree getBlock();
List<? extends CatchTree> getCatches();
BlockTree getFinallyBlock();
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a type cast expression.
*
* For example:
* <pre>
* ( <em>type</em> ) <em>expression</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 15.16"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface TypeCastTree extends ExpressionTree {
Tree getType();
ExpressionTree getExpression();
}

View file

@ -0,0 +1,50 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import java.util.List;
import javax.lang.model.element.Name;
/**
* A tree node for a type parameter.
*
* For example:
* <pre>
* <em>name</em>
*
* <em>name</em> extends <em>bounds</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 4.4"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface TypeParameterTree extends Tree {
Name getName();
List<? extends Tree> getBounds();
}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for postfix and unary expressions.
* Use {@link #getKind getKind} to determine the kind of operator.
*
* For example:
* <pre>
* <em>operator</em> <em>expression</em>
*
* <em>expression</em> <em>operator</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, sections 15.14 and 15.15"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface UnaryTree extends ExpressionTree {
ExpressionTree getExpression();
}

View file

@ -0,0 +1,49 @@
/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
import javax.lang.model.element.Name;
/**
* A tree node for a variable declaration.
*
* For example:
* <pre>
* <em>modifiers</em> <em>type</em> <em>name</em> <em>initializer</em> ;
* </pre>
*
* @see "The Java Language Specification, 3rd ed, sections 8.3 and 14.4"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface VariableTree extends StatementTree {
ModifiersTree getModifiers();
Name getName();
Tree getType();
ExpressionTree getInitializer();
}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a 'while' loop statement.
*
* For example:
* <pre>
* while ( <em>condition</em> )
* <em>statement</em>
* </pre>
*
*
* @see "The Java Language Specification, 3rd ed, section 14.12"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface WhileLoopTree extends StatementTree {
ExpressionTree getCondition();
StatementTree getStatement();
}

View file

@ -0,0 +1,49 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.source.tree;
/**
* A tree node for a wildcard type argument.
* Use {@link #getKind getKind} to determine the kind of bound.
*
* For example:
* <pre>
* ?
*
* ? extends <em>bound</em>
*
* ? super <em>bound</em>
* </pre>
*
* @see "The Java Language Specification, 3rd ed, section 4.5.1"
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
public interface WildcardTree extends Tree {
Tree getBound();
}

View file

@ -0,0 +1,34 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* Provides interfaces to represent source code as abstract syntax
* trees (AST).
*
* @author Peter von der Ah&eacute;
* @author Jonathan Gibbons
* @since 1.6
*/
package com.sun.source.tree;