Skip to content

Commit

Permalink
メソッド出力項目の拡充
Browse files Browse the repository at this point in the history
refs #9
  • Loading branch information
love2hina-net committed Aug 28, 2021
1 parent d3fa310 commit 160b438
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 4 deletions.
78 changes: 74 additions & 4 deletions src/main/powershell/TargetInfo.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,91 @@ class MethodTargetInfo : TargetInfo {
[string] $comment
# 修飾子
[string] $modifier
# 戻り値型
[string] $return
# 名前
[string] $name
# 定義
[string] $definition

# 引数
[ParameterTargetInfo[]] $parameters = @()
# 戻り値
[ReturnTargetInfo[]] $return = @()
# 例外
[ThrowsTargetInfo[]] $throws = @()

MethodTargetInfo([XPathNavigator]$node) : base($node) {

$this.comment = $node.Evaluate('comment/text()')
$this.comment = $node.Evaluate('description/text()')
$this.modifier = $node.Evaluate('@modifier')
$this.name = $node.Evaluate('@name')
$this.definition = $node.Evaluate('definition/text()')

foreach ($i in $node.Evaluate('parameter')) {
$this.parameters += [ParameterTargetInfo]::new($i)
}

foreach ($i in $node.Evaluate('return')) {
$this.return += [ReturnTargetInfo]::new($i)
}

foreach ($i in $node.Evaluate('throws')) {
$this.throws += [ThrowsTargetInfo]::new($i)
}
}

}

class ParameterTargetInfo: TargetInfo {

# コメント
[string] $comment
# 修飾子
[string] $modifier
# 型名
[string] $type
# 名前
[string] $name

ParameterTargetInfo([XPathNavigator]$node) : base($node) {

$this.comment = $node.Evaluate('text()')
$this.modifier = $node.Evaluate('@modifier')
$this.return = $node.Evaluate('@return')
$this.type = $node.Evaluate('@type')
$this.name = $node.Evaluate('@name')
}

}

class ReturnTargetInfo: TargetInfo {

# コメント
[string] $comment
# 型名
[string] $type

ReturnTargetInfo([XPathNavigator]$node) : base($node) {

$this.comment = $node.Evaluate('text()')
$this.type = $node.Evaluate('@type')
}

}

class ThrowsTargetInfo: TargetInfo {

# コメント
[string] $comment
# 型名
[string] $type

ThrowsTargetInfo([XPathNavigator]$node) : base($node) {

$this.comment = $node.Evaluate('text()')
$this.type = $node.Evaluate('@type')
}

}

class DescriptionTargetInfo : TargetInfo {

# 段落番号
Expand Down
Binary file modified template/test.xlsm
Binary file not shown.

0 comments on commit 160b438

Please sign in to comment.