Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.
 
Please complete the following python code precisely:
```python
class Solution:
    def generateMatrix(self, n: int) -> List[List[int]]:
```