The Abraxas Project
Find a file
2026-08-02 21:59:21 +09:00
.idea Downgrade project JDK and bytecode target level to Java 17 2026-07-02 08:47:10 +09:00
.vscode The Abraxas, reborn 2026-06-21 14:51:20 +09:00
egg Code reviewed by Codex. 2026-08-02 21:59:21 +09:00
gradle Bump library versions: update slf4j to 2.0.18 and monolog to 1.3.1; add mavenForgejo repository with HTTP header authentication 2026-07-19 15:14:26 +09:00
.gitattributes The Abraxas, reborn 2026-06-21 14:51:20 +09:00
.gitignore Remove legacy Abraxas-related files and code 2026-06-28 13:58:00 +09:00
abraxas.png Remove legacy Abraxas-related files and code 2026-06-28 13:58:00 +09:00
AGENTS.md Remove legacy Abraxas-related files and code 2026-06-28 13:58:00 +09:00
ANSI Escape Code.md Add ANSI escape code utilities, StyledString builder, and ASCII table formatter; bump version to 6.3.0 2026-07-05 00:16:34 +09:00
gradle.properties The Abraxas, reborn 2026-06-21 14:51:20 +09:00
gradlew Update Gradle wrapper to 9.6.0 and set artifactId to "abraxas" 2026-06-28 14:08:38 +09:00
gradlew.bat Update Gradle wrapper to 9.6.0 and set artifactId to "abraxas" 2026-06-28 14:08:38 +09:00
LICENSE The Abraxas, reborn 2026-06-21 14:51:20 +09:00
README.md Code reviewed by Codex. 2026-08-02 21:59:21 +09:00
settings.gradle.kts Remove legacy Abraxas-related files and code 2026-06-28 13:58:00 +09:00

Abraxas

The bird fights its way out of the egg. The egg is the world. Who would be born must first destroy a world. The bird flies to God. That God's name is Abraxas.

Abraxas

Abraxas는 Java 애플리케이션에서 반복적으로 사용되는 저수준 데이터 처리, 콘솔 입출력, 리플렉션, 운영체제 프로세스, 날짜·시간 기능을 제공하는 유틸리티 라이브러리입니다.

프로젝트는 egg 라이브러리 모듈로 구성되며, Java 표준 API를 중심으로 구현되어 별도의 런타임 외부 라이브러리 의존성을 최소화합니다. Lombok은 라이브러리 컴파일 시에만 사용됩니다.

현재 버전

  • Abraxas: 6.6.2
  • Java toolchain: 17
  • 테스트: JUnit Jupiter 6.1.0
  • 라이선스: Apache License 2.0

주요 기능

Codex — 데이터 변환 및 버퍼

패키지: com.elex_project.abraxas.codex

  • byte[]short, int, long, float, double 간 변환
  • Big-Endian 및 Little-Endian 지원
  • 배열 offset을 이용한 복사 없는 primitive 인코딩·디코딩
  • unsigned 8/16/32-bit 값 변환
  • Hex 및 Binary 문자열 변환
  • Varint/VLQ 인코딩·디코딩
  • CRC-16/Modbus 및 CRC-8/MAXIM 계산
  • ZLIB 압축·해제
  • 난독화 문자열 변환 및 timing-safe byte 배열 비교
  • 비트 조작과 primitive 배열 boxing
  • RingBuffer, SmartyBuffer, ByteBufferPool
  • 한글 자모 분해 및 호환 자모 변환

Console — CLI 입출력

패키지: com.elex_project.abraxas.console

  • 표준 입력·출력 래퍼
  • 문자열, 숫자, boolean, BigInteger, BigDecimal 입력
  • 입력 timeout 처리
  • ANSI 커서·화면 제어 코드
  • ANSI 스타일 문자열과 256색/RGB 색상
  • ASCII/Unicode 테이블 출력
  • 명령행 인자 파싱
  • 중첩 인자의 JSON 변환 및 dot notation 처리

Reflex — Reflection 유틸리티

패키지: com.elex_project.abraxas.reflex

  • 클래스, 필드, 메서드, 생성자 탐색
  • 상속된 멤버 탐색
  • 어노테이션 조회 및 필터링
  • private 멤버 접근
  • 다중 경로 필드 값·타입 조회
  • Type에서 raw Class 추출
  • 패키지 내 클래스 탐색
  • primitive/wrapper 및 날짜·시간 타입 판별

SystemX — 운영체제 기능

패키지: com.elex_project.abraxas.systemx

  • 외부 프로세스 실행
  • 표준 출력 및 표준 오류 동시 수집
  • 비정상 종료 코드와 프로세스 출력 기반 예외 처리
  • JVM shutdown hook 등록·해제

Timex — 날짜·시간

패키지: com.elex_project.abraxas.timex

  • Date, Calendar, Instant, LocalDateTime, ZonedDateTime, OffsetDateTime 변환
  • epoch millisecond 변환
  • 날짜·시간 문자열 파싱 및 포맷팅
  • Duration, Period 계산
  • ZoneId, ZoneOffset, TimeZone 변환
  • DST 경계를 보존하는 instant 변환

프로젝트 구조

abraxas/
├── egg/
│   ├── build.gradle.kts
│   └── src/
│       ├── main/java/com/elex_project/abraxas/
│       │   ├── codex/
│       │   ├── console/
│       │   ├── reflex/
│       │   ├── systemx/
│       │   └── timex/
│       └── test/java/com/elex_project/abraxas/
├── gradle/libs.versions.toml
├── settings.gradle.kts
└── README.md

Java module 이름은 com.elex_project.abraxas이며 다음 패키지를 export합니다.

com.elex_project.abraxas.codex
com.elex_project.abraxas.console
com.elex_project.abraxas.reflex
com.elex_project.abraxas.systemx
com.elex_project.abraxas.timex

빌드 및 테스트

저장소 루트에서 Gradle Wrapper를 사용합니다.

# 전체 빌드
./gradlew build

# egg 모듈만 테스트
./gradlew :egg:test

# egg 모듈 빌드
./gradlew :egg:build

# Javadoc 생성
./gradlew :egg:javadoc

# clean build
./gradlew clean build

테스트는 JUnit Platform을 사용하며, 현재 egg 모듈의 테스트에는 primitive 변환, 버퍼, 한글, 콘솔, 리플렉션, 날짜·시간 및 경계 조건 검증이 포함되어 있습니다.

설치

Gradle

배포 저장소를 사용하는 경우 프로젝트의 Maven 저장소 정책에 맞는 URL과 인증 정보를 설정한 뒤 다음과 같이 의존성을 추가합니다.

repositories {
    maven {
        name = "Elex Repository"
        url = uri("https://artifacts.elex-project.com/repository/maven/")
    }
}

dependencies {
    implementation("com.elex-project:abraxas:6.6.2")
}

저장소 인증 정보는 프로젝트에 커밋하지 말고 사용자 Gradle 설정 또는 CI secret으로 관리해야 합니다.

Maven

<dependency>
    <groupId>com.elex-project</groupId>
    <artifactId>abraxas</artifactId>
    <version>6.6.2</version>
</dependency>

사용 예제

Primitive와 Hex 변환

import com.elex_project.abraxas.codex.Codex;

byte[] encoded = Codex.toByteArray(0x12345678);
String hex = Codex.toHexString(encoded);
int decoded = Codex.toInt(encoded);

System.out.println(hex);     // 12345678
System.out.println(decoded); // 305419896

Little-Endian 변환은 전용 메서드를 사용합니다.

byte[] littleEndian = Codex.toByteArrayLE(0x12345678);
int value = Codex.toIntLE(littleEndian, 0);

버퍼 사용

import com.elex_project.abraxas.codex.SmartyBuffer;

SmartyBuffer buffer = SmartyBuffer.allocate(32);
buffer.write(42);
buffer.write(3.14f);

int number = buffer.readInt();
float decimal = buffer.readFloat();

CRC와 압축

import com.elex_project.abraxas.codex.Codex;

byte[] payload = "Abraxas".getBytes(java.nio.charset.StandardCharsets.UTF_8);
int crc16 = Codex.calculateCRC16(payload);
byte[] compressed = Codex.compress(payload);
byte[] restored = Codex.decompress(compressed);

콘솔 출력과 ANSI 스타일

import com.elex_project.abraxas.console.Console;
import com.elex_project.abraxas.console.StyledString;

Console.writeLine("Hex: {}", "1234abcd");
Console.writeLine(StyledString.builder().text("Success").green().bold());

ANSI 지원 여부가 불확실한 환경에서는 일반 문자열 출력 또는 StyledString.isSupported()를 확인하는 방식을 사용할 수 있습니다.

명령행 인자

import com.elex_project.abraxas.console.Args;

Args parsed = Args.of("--host", "localhost", "--port=8080", "--verbose");
String host = parsed.get("host").orElse("localhost");
int port = parsed.getInt("port").orElse(8080);
boolean verbose = parsed.has("verbose");

중첩 JSON은 dot notation으로 평탄화됩니다.

Args config = Args.ofJson("{\"server\":{\"port\":8080}}");
int port = config.getInt("server.port").orElseThrow();

리플렉션

import com.elex_project.abraxas.reflex.Reflex;

Object value = Reflex.getValue(target, "settings", "timeout");
Class<?> type = Reflex.getType(target, "settings", "timeout");

private 멤버 접근과 모듈 경계를 넘는 reflective access는 Java module 설정에 따라 제한될 수 있습니다.

외부 프로세스 실행

import com.elex_project.abraxas.systemx.SystemX;

var output = SystemX.exec(new String[]{"java", "-version"});

프로세스의 표준 출력과 표준 오류는 동시에 소비되며, 종료 코드가 0이 아니면 IOException이 발생합니다.

API 문서

각 패키지의 package-info.java와 모듈 설명은 Javadoc에 포함됩니다. 다음 명령으로 생성할 수 있습니다.

./gradlew :egg:javadoc

생성된 문서는 egg/build/docs/javadoc/index.html에서 확인할 수 있습니다.

개발 규칙

  • 공개 API에는 영문 Javadoc을 작성합니다.
  • 예외 메시지는 영문으로 작성합니다.
  • 경계 조건과 null 입력을 테스트합니다.
  • 상태를 갖지 않는 유틸리티는 thread-safe한 구조를 유지합니다.
  • 새로운 외부 런타임 의존성 추가를 피합니다.

라이선스

Apache License 2.0

Copyright © 2026 Elex. All rights reserved.