Ejemplo n.º 1
0
 public Object parse() throws RuntimeException {
   NBTList list = new NBTList();
   for (TypeParser var2 : parsers) {
     list.add(nbtUtils.getValue(var2.parse()));
   }
   return list.getHandle();
 }
Ejemplo n.º 2
0
 public Object parse() throws RuntimeException {
   NBTCompound result = new NBTCompound();
   for (TypeParser parser : this.parsers) {
     String key = parser.name;
     if (key.startsWith("\"") && key.endsWith("\"")) {
       key = StringParser.parse(key.substring(1, key.length() - 1));
     }
     result.put(key, (nbtUtils.getValue(parser.parse())));
   }
   return result.getHandle();
 }
Ejemplo n.º 3
0
  public static ListType<?> getInstance(TypeParser parser)
      throws ConfigurationException, SyntaxException {
    List<AbstractType<?>> l = parser.getTypeParameters();
    if (l.size() != 1) throw new ConfigurationException("ListType takes exactly 1 type parameter");

    return getInstance(l.get(0));
  }
Ejemplo n.º 4
0
  @Override
  public String toString(boolean ignoreFreezing) {
    boolean includeFrozenType = !ignoreFreezing && !isMultiCell();

    StringBuilder sb = new StringBuilder();
    if (includeFrozenType) sb.append(FrozenType.class.getName()).append("(");
    sb.append(getClass().getName());
    sb.append(
        TypeParser.stringifyTypeParameters(
            Collections.<AbstractType<?>>singletonList(elements), ignoreFreezing || !isMultiCell));
    if (includeFrozenType) sb.append(")");
    return sb.toString();
  }
Ejemplo n.º 5
0
 protected void appendToStringBuilder(StringBuilder sb) {
   sb.append(getClass().getName())
       .append(
           TypeParser.stringifyTypeParameters(
               Collections.<AbstractType<?>>singletonList(elements)));
 }