示例#1
0
            public static ElementValue Read(BinaryReader Reader, ConstantPool Pool)
            {
                ElementValueTag Tag = (ElementValueTag)Reader.ReadByte();

                switch (Tag)
                {
                case ElementValueTag.Byte: return(ByteElementValue.Read(Reader, Pool));

                case ElementValueTag.Char: return(CharElementValue.Read(Reader, Pool));

                case ElementValueTag.Double: return(DoubleElementValue.Read(Reader, Pool));

                case ElementValueTag.Float: return(FloatElementValue.Read(Reader, Pool));

                case ElementValueTag.Integer: return(IntegerElementValue.Read(Reader, Pool));

                case ElementValueTag.Long: return(LongElementValue.Read(Reader, Pool));

                case ElementValueTag.Short: return(ShortElementValue.Read(Reader, Pool));

                case ElementValueTag.Boolean: return(BooleanElementValue.Read(Reader, Pool));

                case ElementValueTag.String: return(StringElementValue.Read(Reader, Pool));

                case ElementValueTag.Enum: return(EnumElementValue.Read(Reader, Pool));

                case ElementValueTag.Class: return(ClassElementValue.Read(Reader, Pool));

                case ElementValueTag.Annotation: return(AnnotationElementValue.Read(Reader, Pool));

                case ElementValueTag.Array: return(ArrayElementValue.Read(Reader, Pool));

                default: return(null);
                }
            }
        /**
         * Returns the initialization value.
         *
         * @return  The initialization value.
         */
        public AnnotationElementValue getValue()
        {
            if (mValue == null) {
            AST2JSOMTree tree = (AST2JSOMTree)getTreeNode();
            if (!mIsDefaultInitializer) {
                tree = (AST2JSOMTree)tree.GetChild(0);
            }
            mValue =
                new AST2AnnotationElementValue(tree, getTokenRewriteStream());
            }

            return mValue;
        }
        /**
         * Call back method that must be called as soon as the given <code>
         * AnnotationElementValue</code> object has been traversed.
         *
         * @param pAnnotationElementValue  The <code>AnnotationElementValue</code>
         *                                 object that has just been traversed.
         */
        public void actionPerformed(

            AnnotationElementValue pAnnotationElementValue)
        {
            // Nothing to do.
        }
 /**
  * Call back method that must be called when the given <code>
  * AnnotationElementValue</code> will become the next <i>traverse
  * candidate</i>.
  *
  * @param pAnnotationElementValue  The <code>AnnotationElementValue</code>
  *                                 object that will become the next <i>
  *                                 traverse candidate</i>.
  */
 public void performAction(
      
     AnnotationElementValue pAnnotationElementValue)
 {
     // Nothing to do.
 }
        /**
         * Returns the annotation method declaration's default value.
         *
         * @return  The annotation method declaration's default value or <code>null
         *          </code> if no default value has been stated.
         */
        public AnnotationElementValue getDefaultValue()
        {
            if (!mHasDefaultValue) {
            return null; // There's no default value.
            }
            if (mDefaultValue == null) {
            mDefaultValue = new AST2AnnotationElementValue(
                    (AST2JSOMTree)getTreeNode().GetChild(3).GetChild(0),
                    getTokenRewriteStream());
            }

            return mDefaultValue;
        }