To develop this Java application, we'll use the following technologies:

1. Spring Boot: To create a RESTful API and manage dependencies.
2. Maven: As a build tool for our project.
3. MongoDB: For storing word frequency statistics.
4. JWT: For authentication and authorization.

Here's a step-by-step guide to developing the application:

Step 1: Set up the project

Create a new Spring Boot project using https://start.spring.io/ or your favorite IDE with the following dependencies:

- Web
- Security
- MongoDB
- Lombok (optional)

Step 2: Configure MongoDB

Add the following properties in `application.properties` file:

```
spring.data.mongodb.uri=mongodb://localhost:27017/word_statistics_db
```

Replace the URI with your own MongoDB instance details if needed.

Step 3: Create WordFrequency model

Create a new class called `WordFrequency.java`:

```java
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@Document(collection = "word_frequencies")
public class WordFrequency {
    @Id
    private String id;
    private String word;
    private int frequency;
}
```

Step 4: Create UserRepository

Create a new interface called `WordFrequencyRepository.java`:

```java
import org.springframework.data.mongodb.repository.MongoRepository;

public interface WordFrequencyRepository extends MongoRepository<WordFrequency, String> {
    WordFrequency findByWord(String word);
}
```

Step 5: Implement text analysis service

Create a new class called `TextAnalysisService.java`:

```java
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Service
public class TextAnalysisService {

    @Autowired
    private WordFrequencyRepository wordFrequencyRepository;

    public void analyzeText(String text) {
        Map<String, Integer> wordFrequencyMap = new HashMap<>();

        Pattern pattern = Pattern.compile("\\w+");
        Matcher matcher = pattern.matcher(text.toLowerCase());

        while (matcher.find()) {
            String word = matcher.group();
            wordFrequencyMap.put(word, wordFrequencyMap.getOrDefault(word, 0) + 1);
        }

        for (Map.Entry<String, Integer> entry : wordFrequencyMap.entrySet()) {
            WordFrequency wordFrequency = wordFrequencyRepository.findByWord(entry.getKey());
            if (wordFrequency == null) {
                wordFrequency = new WordFrequency();
                wordFrequency.setWord(entry.getKey());
            }
            wordFrequency.setFrequency(wordFrequency.getFrequency() + entry.getValue());
            wordFrequencyRepository.save(wordFrequency);
        }
    }
}
```

Step 6: Implement JWT authentication and authorization

Follow this tutorial to implement JWT authentication and authorization in your Spring Boot application: https://auth0.com/blog/implementing-jwt-authentication-on-spring-boot/

Step 7: Create RESTful API endpoints

Create a new class called `TextAnalysisController.java`:

```java
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class TextAnalysisController {

    @Autowired
    private TextAnalysisService textAnalysisService;

    @PostMapping("/analyze-text")
    @PreAuthorize("hasRole('USER')")
    public void analyzeText(@RequestBody String text) {
        textAnalysisService.analyzeText(text);
    }

    @GetMapping("/word-frequency/{word}")
    @PreAuthorize("hasRole('USER')")
    public WordFrequency getWordFrequency(@PathVariable String word) {
        return wordFrequencyRepository.findByWord(word);
    }

    @GetMapping("/top-words/{n}")
    @PreAuthorize("hasRole('USER')")
    public List<WordFrequency> getTopWords(@PathVariable int n) {
        return wordFrequencyRepository.findAll(Sort.by(Sort.Direction.DESC, "frequency")).stream().limit(n).collect(Collectors.toList());
    }
}
```

Now you have a Java application that analyzes text documents and generates word frequency statistics. The results are stored in a MongoDB collection, and the RESTful API allows querying the statistics by word or top N frequent words. JWT tokens are used for authentication and authorization.
이 Java 애플리케이션을 개발하기 위해 다음 기술을 사용합니다:

1. Spring Boot: RESTful API를 생성하고 종속성을 관리합니다.
2. Maven: 프로젝트를 위한 빌드 도구.
3. 몽고DB: 단어 빈도 통계를 저장하기 위해.
4. JWT: 인증 및 권한 부여용.

다음은 애플리케이션 개발에 대한 단계별 가이드입니다:

1단계: 프로젝트 설정

https://start.spring.io/ 또는 선호하는 IDE를 사용하여 다음 종속성을 사용하여 새 Spring Boot 프로젝트를 만듭니다:

- Web
- Security
- MongoDB
- 롬복(선택 사항)

2단계: MongoDB 구성

application.properties` 파일에 다음 속성을 추가합니다:

```
spring.data.mongodb.uri=mongodb://localhost:27017/word_statistics_db
```

필요한 경우 URI를 자체 MongoDB 인스턴스 세부 정보로 바꿉니다.

3단계: WordFrequency 모델 생성

WordFrequency.java`라는 새 클래스를 생성합니다:

```java
lombok.Data를 가져옵니다;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
도큐먼트(컬렉션 = "word_frequencies")
public class WordFrequency {
    @Id
    private String id;
    private String word;
    private int frequency;
}
```

4단계: 사용자 저장소 만들기

WordFrequencyRepository.java`라는 새로운 인터페이스를 생성합니다:

```java
org.springframework.data.mongodb.repository.MongoRepository를 가져옵니다;

public interface WordFrequencyRepository extends MongoRepository<WordFrequency, String> {
    WordFrequency findByWord(String word);
}
```

5단계: 텍스트 분석 서비스 구현하기

TextAnalysisService.java`라는 클래스를 새로 생성합니다:

```java
java.util.HashMap을 가져옵니다;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Service
public class TextAnalysisService {

    @Autowired
    비공개 단어 빈도 저장소 wordFrequencyRepository;

    public void analyzeText(String text) {
        Map<String, Integer> wordFrequencyMap = new HashMap<>();

        패턴 pattern = Pattern.compile("\\w+");
        일치자 matcher = pattern.matcher(text.toLowerCase());

        while (matcher.find()) {
            String word = matcher.group();
            wordFrequencyMap.put(word, wordFrequencyMap.getOrDefault(word, 0) + 1);
        }

        for (Map.Entry<String, Integer> entry : wordFrequencyMap.entrySet()) {
            단어 빈도 wordFrequency = wordFrequencyRepository.findByWord(entry.getKey());
            if (wordFrequency == null) {
                wordFrequency = 새로운 단어 빈도();
                wordFrequency.setWord(entry.getKey());
            }
            wordFrequency.setFrequency(wordFrequency.getFrequency() + entry.getValue());
            wordFrequencyRepository.save(wordFrequency);
        }
    }
}
```

6단계: JWT 인증 및 권한 부여 구현하기

이 튜토리얼을 따라 Spring Boot 애플리케이션에서 JWT 인증 및 권한 부여를 구현하세요(https://auth0.com/blog/implementing-jwt-authentication-on-spring-boot/).

7단계: RESTful API 엔드포인트 만들기

TextAnalysisController.java`라는 새 클래스를 생성합니다:

```java
org.springframework.beans.factory.annotation.Autowired를 가져옵니다;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

RestController
@RequestMapping("/api")
public class TextAnalysisController {

    @Autowired
    private TextAnalysisService textAnalysisService;

    @PostMapping("/analyze-text")
    사전승인("hasRole('USER')")
    public void analyzeText(@RequestBody String text) {
        textAnalysisService.analyzeText(text);
    }

    @GetMapping("/word-frequency/{word}")
    @PreAuthorize("hasRole('USER')")
    public WordFrequency getWordFrequency(@PathVariable String word) {
        return wordFrequencyRepository.findByWord(word);
    }

    @GetMapping("/top-words/{n}")
    @PreAuthorize("hasRole('USER')")
    public List<WordFrequency> getTopWords(@PathVariable int n) {
        return wordFrequencyRepository.findAll(Sort.by(Sort.Direction.DESC, "frequency")).stream().limit(n).collect(Collectors.toList());
    }
}
```

이제 텍스트 문서를 분석하고 단어 빈도 통계를 생성하는 Java 애플리케이션이 생겼습니다. 결과는 몽고DB 컬렉션에 저장되며, RESTful API를 통해 단어 또는 상위 N개의 빈번한 단어별로 통계를 쿼리할 수 있습니다. JWT 토큰은 인증 및 권한 부여에 사용됩니다.