public class Verifier extends Object
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Modifiers | Name | Description |
---|---|---|
interface |
Verifier.DefaultArgsAction |
Modifiers | Name | Description |
---|---|---|
static String |
INITIAL_EXPRESSION |
|
static String |
STATIC_METACLASS_BOOL |
|
static String |
SWAP_INIT |
|
static String |
__TIMESTAMP |
|
static String |
__TIMESTAMP__ |
Type | Name and description |
---|---|
protected void |
addClosureCode(InnerClassNode node) |
protected void |
addConstructor(Parameter[] newParams, ConstructorNode ctor, Statement code, ClassNode node) |
protected void |
addCovariantMethods(ClassNode classNode) |
protected void |
addDefaultConstructor(ClassNode node) |
protected void |
addDefaultParameterConstructors(ClassNode node) |
protected void |
addDefaultParameterMethods(ClassNode node) Creates a new helper method for each combination of default parameter expressions |
protected void |
addDefaultParameters(List methods, Verifier.DefaultArgsAction action) Creates a new helper method for each combination of default parameter expressions |
protected void |
addDefaultParameters(Verifier.DefaultArgsAction action, MethodNode method) |
protected void |
addFieldInitialization(List list, List staticList, FieldNode fieldNode, boolean isEnumClassNode, List initStmtsAfterEnumValuesInit, Set explicitStaticPropsInEnum) |
protected void |
addGroovyObjectInterfaceAndMethods(ClassNode node, String classInternalName) |
protected void |
addInitialization(ClassNode node) |
protected void |
addInitialization(ClassNode node, ConstructorNode constructorNode) |
protected void |
addMethod(ClassNode node, boolean shouldBeSynthetic, String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) the code is: if (this.metaClass==null) { this.metaClass = this. |
protected void |
addPropertyMethod(MethodNode method) |
protected void |
addReturnIfNeeded(MethodNode node) |
protected void |
addTimeStamp(ClassNode node) |
static String |
capitalize(String name) Capitalizes the start of the given bean property name |
protected Statement |
createGetterBlock(PropertyNode propertyNode, FieldNode field) |
protected Statement |
createSetterBlock(PropertyNode propertyNode, FieldNode field) |
ClassNode |
getClassNode() |
MethodNode |
getMethodNode() |
static long |
getTimestamp(Class clazz) |
protected void |
setClassNode(ClassNode classNode) |
static ConstantExpression |
transformToPrimitiveConstantIfPossible(ConstantExpression constantExpression) When constant expressions are created, the value is always wrapped to a non primitive type. |
void |
visitClass(ClassNode node) add code to implement GroovyObject |
void |
visitConstructor(ConstructorNode node) |
void |
visitField(FieldNode node) |
void |
visitGenericType(GenericsType genericsType) |
void |
visitMethod(MethodNode node) |
void |
visitProperty(PropertyNode node) |
Creates a new helper method for each combination of default parameter expressions
Creates a new helper method for each combination of default parameter expressions
the code is: if (this.metaClass==null) { this.metaClass = this.$getStaticMetaClass return this.metaClass } else { return this.metaClass } with the optimization that the result of the first this.metaClass is duped on the operand stack and reused for the return in the else part
When constant expressions are created, the value is always wrapped to a non primitive type. Some constant expressions are optimized to return primitive types, but not all primitives are handled. This method guarantees to return a similar constant expression but with a primitive type instead of a boxed type. Additionaly, single char strings are converted to 'char' types.
constantExpression
- a constant expressionadd code to implement GroovyObject