Documentation
¶
Overview ¶
Package project provides functionality for working with Java source files in a project structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesystemClass ¶
type FilesystemClass struct {
// contains filtered or unexported fields
}
FilesystemClass represents a Java class file stored in the filesystem.
func (*FilesystemClass) Content ¶
func (c *FilesystemClass) Content() string
Content returns the content of the Java class file.
func (*FilesystemClass) Name ¶
func (c *FilesystemClass) Name() string
Name returns the name of the Java class.
func (*FilesystemClass) SetContent ¶
func (c *FilesystemClass) SetContent(content string) error
SetContent updates the content of the Java class file and writes it to the filesystem.
type FilesystemProject ¶
type FilesystemProject struct {
// contains filtered or unexported fields
}
FilesystemProject represents a project stored in the filesystem.
func NewFilesystem ¶
func NewFilesystem(path string) *FilesystemProject
NewFilesystem creates a new FilesystemProject with the given path.
func (*FilesystemProject) Classes ¶
func (p *FilesystemProject) Classes() ([]domain.Class, error)
Classes retrieves all Java classes in the project directory and its subdirectories.
func (*FilesystemProject) String ¶
func (p *FilesystemProject) String() string
String returns the string representation of the FilesystemProject.
type InMemoryJavaClass ¶
type InMemoryJavaClass struct {
// contains filtered or unexported fields
}
InMemoryJavaClass is an implementation of JavaClass that stores its data in memory.
func (*InMemoryJavaClass) Content ¶
func (i *InMemoryJavaClass) Content() string
Content retrieves the content of the in-memory Java class.
func (*InMemoryJavaClass) Name ¶
func (i *InMemoryJavaClass) Name() string
Name retrieves the name of the in-memory Java class.
func (*InMemoryJavaClass) SetContent ¶
func (i *InMemoryJavaClass) SetContent(content string) error
SetContent updates the content of the in-memory Java class.
type InMemoryProject ¶
type InMemoryProject struct {
// contains filtered or unexported fields
}
InMemoryProject is an implementation of Project that stores its classes in memory.
func (*InMemoryProject) Classes ¶
func (i *InMemoryProject) Classes() ([]domain.Class, error)
Classes retrieves all Java classes in the in-memory project.
func (*InMemoryProject) String ¶
func (i *InMemoryProject) String() string
String returns a string representation of the in-memory project.
type MirrorProject ¶
type MirrorProject struct {
// contains filtered or unexported fields
}
MirrorProject decorates FilesystemProject with a mirror location to avoid modifying the original.
func NewMirrorProject ¶
func NewMirrorProject(original *FilesystemProject, mirrorPath string) (*MirrorProject, error)
NewMirrorProject creates a mirror of the original FilesystemProject at the given path.
type Project ¶
type Project interface {
// Classes retrieves all Java classes within the project.
Classes() ([]domain.Class, error)
}
Project represents an interface for managing Java classes within a project.
func NewInMemory ¶
NewInMemory creates a new in-memory project with the given map of file names to Java class content.
func NewMock ¶
func NewMock() Project
NewMock creates a mock project with predefined content for testing purposes.
func SingleClass ¶
SingleClass creates a project containing a single Java class with the provided name and content.