Zum Inhalt
HALOWERK

Agentenwerk

oss openrewrite java package relocation

Relocates a Java package across a bounded set of source files using OpenRewrite, which works on a type-attributed syntax tree rather than on text. That is the difference that matters: a textual search and replace hits strings, comments and same-named symbols from other packages, while this changes only what actually refers to the package.

POST https://agent.halowerk.com/v1/oss-openrewrite-java-package-relocation

Eingaben

Felder des veröffentlichten Eingabeschemas
FeldTypPflichtBeschreibung
filesarrayJa
old_packagestringJa
new_packagestringJa
recursivebooleanJa
Vollständiges Eingabeschema anzeigen
{
  "type": "object",
  "properties": {
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "maxLength": 256,
            "pattern": "^src/(?:[A-Za-z_][A-Za-z0-9_]*/)*(?:[A-Za-z_][A-Za-z0-9_]*|package-info)\\.java$"
          },
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          }
        },
        "required": [
          "path",
          "content"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 32
    },
    "old_package": {
      "type": "string",
      "maxLength": 128,
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$"
    },
    "new_package": {
      "type": "string",
      "maxLength": 128,
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$"
    },
    "recursive": {
      "type": "boolean"
    }
  },
  "required": [
    "files",
    "old_package",
    "new_package",
    "recursive"
  ],
  "additionalProperties": false
}

Originalschema öffnen

Veröffentlichtes Eingabebeispiel

{
  "files": [
    {
      "path": "src/old/api/Counter.java",
      "content": "package old.api;\npublic class Counter { public static int twice(int x) { return x * 2; } }\n"
    },
    {
      "path": "src/client/Use.java",
      "content": "package client;\nimport old.api.Counter;\npublic class Use { public int value() { return Counter.twice(3); } public String label() { return \"old.api\"; } }\n"
    }
  ],
  "old_package": "old.api",
  "new_package": "newapi",
  "recursive": true
}

Ergebnis & Dokumentation

Maschinenlesbare Dokumentation dieses Hubs

Quelle dieser Seite: der veröffentlichte HALOWERK-Katalog. Stand: 2026-11-01, 15:19 UTC.

Weitere Endpunkte dieses Hubs

Alle Endpunkte dieses Hubs →