예제 #1
0
 @Override
 public boolean hasPath(String pathExpression) {
   Path path = Path.newPath(pathExpression);
   ConfigValue peeked;
   try {
     peeked = object.peekPath(path);
   } catch (ConfigException.NotResolved e) {
     throw ConfigImpl.improveNotResolved(path, e);
   }
   return peeked != null && peeked.valueType() != ConfigValueType.NULL;
 }
예제 #2
0
 private static AbstractConfigValue find(
     AbstractConfigObject self, Path path, ConfigValueType expected, Path originalPath) {
   try {
     String key = path.first();
     Path next = path.remainder();
     if (next == null) {
       return findKey(self, key, expected, originalPath);
     } else {
       AbstractConfigObject o =
           (AbstractConfigObject)
               findKey(
                   self,
                   key,
                   ConfigValueType.OBJECT,
                   originalPath.subPath(0, originalPath.length() - next.length()));
       assert (o != null); // missing was supposed to throw
       return find(o, next, expected, originalPath);
     }
   } catch (ConfigException.NotResolved e) {
     throw ConfigImpl.improveNotResolved(path, e);
   }
 }