• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mybatis / mybatis-3 / 3448

11 Jul 2026 06:09PM UTC coverage: 87.453% (+0.003%) from 87.45%
3448

Pull #3690

github

web-flow
Merge 116c6233d into 870b6d7e6
Pull Request #3690: docs: add SqlSessionManager documentation

3873 of 4681 branches covered (82.74%)

9995 of 11429 relevant lines covered (87.45%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.45
/src/main/java/org/apache/ibatis/reflection/property/PropertyTokenizer.java
1
/*
2
 *    Copyright 2009-2023 the original author or authors.
3
 *
4
 *    Licensed under the Apache License, Version 2.0 (the "License");
5
 *    you may not use this file except in compliance with the License.
6
 *    You may obtain a copy of the License at
7
 *
8
 *       https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *    Unless required by applicable law or agreed to in writing, software
11
 *    distributed under the License is distributed on an "AS IS" BASIS,
12
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *    See the License for the specific language governing permissions and
14
 *    limitations under the License.
15
 */
16
package org.apache.ibatis.reflection.property;
17

18
import java.util.Iterator;
19

20
/**
21
 * @author Clinton Begin
22
 */
23
public class PropertyTokenizer implements Iterator<PropertyTokenizer> {
24
  private String name;
25
  private final String indexedName;
26
  private String index;
27
  private final String children;
28

29
  public PropertyTokenizer(String fullname) {
1✔
30
    int delim = fullname.indexOf('.');
1✔
31
    if (delim > -1) {
1✔
32
      name = fullname.substring(0, delim);
1✔
33
      children = fullname.substring(delim + 1);
1✔
34
    } else {
35
      name = fullname;
1✔
36
      children = null;
1✔
37
    }
38
    indexedName = name;
1✔
39
    delim = name.indexOf('[');
1✔
40
    if (delim > -1) {
1✔
41
      if (children == null && !name.endsWith("]")) {
1✔
42
        throw new IllegalArgumentException(
1✔
43
            "Invalid index syntax in property: '" + name + "'. Missing closing bracket.");
44
      }
45
      index = name.substring(delim + 1, name.length() - 1);
1✔
46
      name = name.substring(0, delim);
1✔
47
    }
48
  }
1✔
49

50
  public String getName() {
51
    return name;
1✔
52
  }
53

54
  public String getIndex() {
55
    return index;
1✔
56
  }
57

58
  public String getIndexedName() {
59
    return indexedName;
1✔
60
  }
61

62
  public String getChildren() {
63
    return children;
1✔
64
  }
65

66
  @Override
67
  public boolean hasNext() {
68
    return children != null;
1✔
69
  }
70

71
  @Override
72
  public PropertyTokenizer next() {
73
    return new PropertyTokenizer(children);
×
74
  }
75

76
  @Override
77
  public void remove() {
78
    throw new UnsupportedOperationException(
1✔
79
        "Remove is not supported, as it has no meaning in the context of properties.");
80
  }
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc