summaryrefslogtreecommitdiffhomepage
path: root/src/java/nginx/unit/JspPropertyGroup.java
blob: 2df2771878148e87dcbd3ad370d893e4ff537031 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
package nginx.unit;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.servlet.descriptor.JspPropertyGroupDescriptor;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class JspPropertyGroup implements JspPropertyGroupDescriptor
{
    private final List<String> url_patterns_ = new ArrayList<>();
    private String el_ignored_ = null;
    private String page_encoding_ = null;
    private String scripting_invalid_ = null;
    private String is_xml_ = null;
    private final List<String> include_preludes_ = new ArrayList<>();
    private final List<String> include_codas_ = new ArrayList<>();

    private String deffered_syntax_allowed_as_literal_ = null;
    private String trim_directive_whitespaces_ = null;
    private String default_content_type_ = null;
    private String buffer_ = null;
    private String error_on_undeclared_namespace_ = null;

    public JspPropertyGroup(NodeList nodes)
    {
        for (int i = 0; i < nodes.getLength(); i++) {
            Node node = nodes.item(i);
            String tag_name = node.getNodeName();

            if (tag_name.equals("url-pattern")) {
                url_patterns_.add(node.getTextContent().trim());
                continue;
            }

            if (tag_name.equals("el-ignored")) {
                el_ignored_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("page-encoding")) {
                page_encoding_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("scripting-invalid")) {
                scripting_invalid_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("is-xml")) {
                is_xml_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("include-prelude")) {
                include_preludes_.add(node.getTextContent().trim());
                continue;
            }

            if (tag_name.equals("include-coda")) {
                include_codas_.add(node.getTextContent().trim());
                continue;
            }

            if (tag_name.equals("deferred-syntax-allowed-as-literal")) {
                deffered_syntax_allowed_as_literal_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("trim-directive-whitespaces")) {
                trim_directive_whitespaces_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("default-content-type")) {
                default_content_type_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("buffer")) {
                buffer_ = node.getTextContent().trim();
                continue;
            }

            if (tag_name.equals("error-on-undeclared-namespace")) {
                error_on_undeclared_namespace_ = node.getTextContent().trim();
                continue;
            }
        }

    }

    @Override
    public Collection<String> getUrlPatterns()
    {
        return new ArrayList<>(url_patterns_);
    }

    @Override
    public String getElIgnored()
    {
        return el_ignored_;
    }

    @Override
    public String getPageEncoding()
    {
        return page_encoding_;
    }

    @Override
    public String getScriptingInvalid()
    {
        return scripting_invalid_;
    }

    @Override
    public String getIsXml()
    {
        return is_xml_;
    }

    @Override
    public Collection<String> getIncludePreludes()
    {
        return new ArrayList<>(include_preludes_);
    }

    @Override
    public Collection<String> getIncludeCodas()
    {
        return new ArrayList<>(include_codas_);
    }

    @Override
    public String getDeferredSyntaxAllowedAsLiteral()
    {
        return deffered_syntax_allowed_as_literal_;
    }

    @Override
    public String getTrimDirectiveWhitespaces()
    {
        return trim_directive_whitespaces_;
    }

    @Override
    public String getDefaultContentType()
    {
        return default_content_type_;
    }

    @Override
    public String getBuffer()
    {
        return buffer_;
    }

    @Override
    public String getErrorOnUndeclaredNamespace()
    {
        return error_on_undeclared_namespace_;
    }
}