cangjie-reflect-and-annotation

Explain Cangjie reflection and annotations using TypeInfo and reflective APIs.

4|1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/JunjieChen0/NJUST --skill cangjie-reflect-and-annotation-junjiechen0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-reflect-and-annotation
Source: https://github.com/JunjieChen0/NJUST/tree/main/.njust-ai/skills/cangjie-reflect-and-annotation
Command: npx skills add https://github.com/JunjieChen0/NJUST --skill cangjie-reflect-and-annotation-junjiechen0

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers understand Cangjie language reflection and annotations, including overflow annotations (@OverflowThrowing, @OverflowWrapping, @OverflowSaturating), custom annotations (@Annotation), and reflection (TypeInfo), enabling clearer reasoning about language features.

Core Features & Use Cases

  • Understand built-in and custom annotations in Cangjie and how to retrieve them via TypeInfo.
  • Explore reflection APIs to access instance and static variables, properties, and functions.
  • Use cases include debugging language semantics, designing reflective tools, and learning Cangjie programming patterns.

Quick Start

Apply the skill to explore Cangjie reflection and annotations in a real codebase.

Frequently Asked Questions about cangjie-reflect-and-annotation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Cangjie reflection to access instance and static variables?

Cangjie reflection provides @Annotation for custom annotations and built-in overflow annotations like @OverflowThrowing, @OverflowWrapping, and @OverflowSaturating. You retrieve these annotations dynamically via the TypeInfo interface during runtime inspection.

Can I get static functions and properties using Cangjie reflection?

Yes, Cangjie reflection supports retrieving static functions and properties. The TypeInfo API provides getStaticFunction and getInstanceProperty methods to dynamically access these members for reflective tool design and debugging.

What is the @Annotation custom annotation in Cangjie and how does it work?

The @Annotation custom annotation in Cangjie allows you to define metadata for types and members. You can retrieve custom annotations at runtime using the TypeInfo interface to inspect program semantics dynamically.

What are Cangjie overflow annotations and when should I use them?

Cangjie overflow annotations include @OverflowThrowing, @OverflowWrapping, and @OverflowSaturating. They control arithmetic overflow behavior at compile-time, throwing errors, wrapping values, or saturating results when limits are exceeded.

Does Cangjie reflection support accessing both instance properties and static variables?

Yes, Cangjie reflection supports accessing both instance properties and static variables through TypeInfo. The API includes getInstanceProperty, getStaticVariable, and getInstanceVariable methods for comprehensive member access during runtime inspection.