Naming Conventions

Hyphens in Java Package Name

When creating a location for a Java class, be aware that the package name must match that of the repository folder location with any hyphens in the path properly escaped.

While using hyphens in the names of repository items is a recommended practice in AEM development, hyphens are illegal within Java package names.

The underlying CRX platform must be able to distinguish between an actual underscore _ and a hyphen -. Thus, in JCR, the hyphen must be replaced with its unicode value (u002d) and escaped with an underscore _.

For example, if the repository path is /apps/my-example/component/info/Info.java, the package name should be java package apps.my_002dexample.component.info;

Notice that an underscore must similarly be escaped, such that _ becomes _005f.

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now