Esempio n. 1
0
    def _parse_enumeration_value(self, value, container_code_element):
        field_binding = value.resolveVariable()
        if not self._is_private(field_binding):
            java_element = field_binding.getJavaElement()
            simple_name = value.getName().getIdentifier()
            (_, fqn) = clean_java_name(
                    field_binding.getDeclaringClass().getQualifiedName())
            fqn = fqn + '.' + simple_name
            (type_simple_name, type_fqn) = clean_java_name(
                    field_binding.getType().getQualifiedName())

            field_code_element = FieldElement(codebase=self.codebase,
                    kind=self.enumeration_value_kind,
                    simple_name=simple_name,
                    fqn=fqn,
                    eclipse_handle=java_element.getHandleIdentifier(),
                    type_simple_name=type_simple_name,
                    type_fqn=type_fqn,
                    parser=JAVA_PARSER)
            field_code_element.save()
            field_code_element.containers.add(container_code_element)
Esempio n. 2
0
    def _parse_annotation_field(self, field, container_code_element):
        method_binding = field.resolveBinding()
        if not self._is_private(method_binding):
            java_element = method_binding.getJavaElement()
            simple_name = field.getName().getIdentifier()
            (_, fqn) = clean_java_name(
                    method_binding.getDeclaringClass().getQualifiedName())
            fqn = fqn + '.' + simple_name
            (type_simple_name, type_fqn) = clean_java_name(
                    method_binding.getReturnType().getQualifiedName())

            field_code_element = FieldElement(codebase=self.codebase,
                    kind=self.annotation_field_kind,
                    simple_name=simple_name,
                    fqn=fqn,
                    eclipse_handle=java_element.getHandleIdentifier(),
                    type_simple_name=type_simple_name,
                    type_fqn=type_fqn,
                    attcontainer=container_code_element,
                    parser=JAVA_PARSER)
            field_code_element.save()
            field_code_element.containers.add(container_code_element)
Esempio n. 3
0
    def _parse_enumeration_value(self, value, container_code_element):
        field_binding = value.resolveVariable()
        if not self._is_private(field_binding):
            java_element = field_binding.getJavaElement()
            simple_name = value.getName().getIdentifier()
            (_, fqn) = clean_java_name(
                field_binding.getDeclaringClass().getQualifiedName())
            fqn = fqn + '.' + simple_name
            (type_simple_name, type_fqn) = clean_java_name(
                field_binding.getType().getQualifiedName())

            field_code_element = FieldElement(
                codebase=self.codebase,
                kind=self.enumeration_value_kind,
                simple_name=simple_name,
                fqn=fqn,
                eclipse_handle=java_element.getHandleIdentifier(),
                type_simple_name=type_simple_name,
                type_fqn=type_fqn,
                parser=JAVA_PARSER)
            field_code_element.save()
            field_code_element.containers.add(container_code_element)
Esempio n. 4
0
    def _parse_annotation_field(self, field, container_code_element):
        method_binding = field.resolveBinding()
        if not self._is_private(method_binding):
            java_element = method_binding.getJavaElement()
            simple_name = field.getName().getIdentifier()
            (_, fqn) = clean_java_name(
                method_binding.getDeclaringClass().getQualifiedName())
            fqn = fqn + '.' + simple_name
            (type_simple_name, type_fqn) = clean_java_name(
                method_binding.getReturnType().getQualifiedName())

            field_code_element = FieldElement(
                codebase=self.codebase,
                kind=self.annotation_field_kind,
                simple_name=simple_name,
                fqn=fqn,
                eclipse_handle=java_element.getHandleIdentifier(),
                type_simple_name=type_simple_name,
                type_fqn=type_fqn,
                attcontainer=container_code_element,
                parser=JAVA_PARSER)
            field_code_element.save()
            field_code_element.containers.add(container_code_element)