JavaMethodAnnotationContainer.st
author hlopkmar
Sat, 01 Dec 2012 21:19:57 +0000
branchdevelopment
changeset 1848 b508cc4d4bf0
parent 1818 2e5ed72e7dfd
child 1849 96895c73d62c
permissions -rw-r--r--
raw param annotations saving

"
 COPYRIGHT (c) 1996-2011 by Claus Gittinger

 New code and modifications done at SWING Research Group [1]:

 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                            SWING Research Group, Czech Technical University in Prague

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.

 [1] Code written at SWING Research Group contains a signature
     of one of the above copright owners. For exact set of such code,
     see the differences between this version and version stx:libjava
     as of 1.9.2010
"
"{ Package: 'stx:libjava' }"

JavaAnnotationContainer subclass:#JavaMethodAnnotationContainer
	instanceVariableNames:'annotationDefault rawAnnotations rawParamAnnotations
		visibleParameterAnnotations invisibleParameterAnnotations'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Java-Annotations'
!

!JavaMethodAnnotationContainer class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1996-2011 by Claus Gittinger

 New code and modifications done at SWING Research Group [1]:

 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                            SWING Research Group, Czech Technical University in Prague

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.

 [1] Code written at SWING Research Group contains a signature
     of one of the above copright owners. For exact set of such code,
     see the differences between this version and version stx:libjava
     as of 1.9.2010

"
! !

!JavaMethodAnnotationContainer methodsFor:'accessing'!

default
    ^ annotationDefault

    "Created: / 03-03-2011 / 23:02:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

default:something 
    annotationDefault := something.
!

ensureInvisibleParameterAnnotationsAt: paramIndex 
    ((invisibleParameterAnnotations at: paramIndex) 
        size = 0) 
            ifTrue: 
                [ invisibleParameterAnnotations at: paramIndex
                    put: JavaAnnotationDictionary new ].
    ^ invisibleParameterAnnotations at: paramIndex.

    "Created: / 16-03-2011 / 17:21:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!

ensureVisibleParameterAnnotationsAt: paramIndex 
    ((visibleParameterAnnotations at: paramIndex) 
        size = 0) 
            ifTrue: 
                [ visibleParameterAnnotations at: paramIndex
                    put: JavaAnnotationDictionary new ].
    ^ visibleParameterAnnotations at: paramIndex.

    "Created: / 16-03-2011 / 17:21:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!

rawAnnotations
    ^ rawAnnotations
!

rawAnnotations:something
    rawAnnotations := something.
!

rawParamAnnotations
    ^ rawParamAnnotations
!

rawParamAnnotations:something
    rawParamAnnotations := something.
! !

!JavaMethodAnnotationContainer methodsFor:'initialization'!

initialize
    super initialize.

    visibleParameterAnnotations := #().
    invisibleParameterAnnotations := #().
    annotationDefault := JavaAnnotationDefault empty.

    "Modified: / 28-02-2011 / 16:34:54 / Marcel Hlopko <hlopik@gmail.com>"
    "Modified: / 16-03-2011 / 17:28:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
    "Created: / 18-03-2011 / 23:50:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

initializeFor: javaMethod 
    super initializeFor: javaMethod.
    parent := javaMethod.
    
    visibleParameterAnnotations := Array new: javaMethod javaNumArgs.
    invisibleParameterAnnotations := Array new: javaMethod javaNumArgs.
    1 to: javaMethod javaNumArgs do: [:idx | visibleParameterAnnotations at: idx put: JavaAnnotationDictionary empty.invisibleParameterAnnotations at: idx put: JavaAnnotationDictionary empty. ].
    annotationDefault := JavaAnnotationDefault empty.

    "Modified: / 28-02-2011 / 16:34:54 / Marcel Hlopko <hlopik@gmail.com>"
    "Modified: / 03-03-2011 / 22:48:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 16-03-2011 / 17:28:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !

!JavaMethodAnnotationContainer class methodsFor:'documentation'!

version_SVN
    ^ '$Id$'
! !