コード例 #1
0
 @Override
 public List<CuboidRegion> parse(ParsingContext context) throws ModuleParsingException {
   String name = context.getElement().getAttributeValue("name");
   BlockRegion a =
       ParsingUtil.parse(
           name, context.getElement(), check(context.getElement().getAttributeValue("min")));
   BlockRegion b =
       ParsingUtil.parse(
           name, context.getElement(), check(context.getElement().getAttributeValue("max")));
   return Lists.newArrayList(new CuboidRegion(name, a, b));
 }
コード例 #2
0
    public String check(String value) throws ModuleParsingException {
      Map<String, String> points = ParsingUtil.parse(value);
      if (!points.containsKey("y")) {
        throw new ModuleParsingException(
            RectangleRegion.class, "CuboidRegions require a Y coordinate value");
      }

      return value;
    }