Examples of DefinitionType


Examples of com.volantis.mcs.model.validation.integrity.DefinitionType

        }
        if (handler == null) {
            throw new IllegalArgumentException("handler cannot be null");
        }
       
        DefinitionType type = (DefinitionType) definitionTypeRegistry.get(
                definitionClass);
        if (type != null) {
            throw new IllegalArgumentException(
                    "Definition type for " + definitionClass +
                    " is already registered");
        }

        type = new DefinitionType(handler);
        definitionTypeRegistry.put(definitionClass, type);
        return type;
    }
View Full Code Here

Examples of factbookxml.converter.schema.DefinitionType

    return result;
  }

  public static DefinitionType parseDefinitionType(String name, String html) {
    ObjectFactory of = new ObjectFactory();
    DefinitionType result = new DefinitionType();
    result.setName(name);
    int pos = html.indexOf('<');
    while (pos != -1) {
      if (pos != 0)
        result.getContent().add(parseHTML(html.substring(0, pos)));
      html = html.substring(pos);
      if (html.startsWith("<i>") || html.startsWith("<b>")) {
        ParsePosition pp = new ParsePosition(0);
        HypertextType inner = parseHypertextType(html.substring(3), pp);
        if (!html.substring(pp.getIndex() + 3, pp.getIndex() + 7).equals("</" + html.substring(1, 3)))
          throw new RuntimeException("Start " + html.substring(0, 3) + " was closed by " + html.substring(pp.getIndex() + 3, pp.getIndex() + 7));
        if (html.startsWith("<b>")) {
          result.getContent().add(of.createDefinitionTypeBold(inner));
        } else {
          result.getContent().add(of.createDefinitionTypeItalic(inner));
        }
        html = html.substring(pp.getIndex() + 7);
      } else if (html.startsWith("<br />")) {
        result.getContent().add(of.createDefinitionTypeNewLine(of.createEmptyType()));
        html = html.substring(6);
      } else if (html.startsWith("<a href=\"appendix-") && html.startsWith(".html\">", "<a href=\"appendix-".length() + 1)) {
        html = html.substring("<a href=\"appendix-".length());
        DefinitionType.AppendixReference app = of.createDefinitionTypeAppendixReference();
        app.setLetter(html.substring(0, 1));
        html = html.substring(".html\">".length() + 1);
        pos = html.indexOf("</a>");
        app.setTitle(parseHTML(html.substring(0, pos)));
        html = html.substring(pos + 4);
        result.getContent().add(of.createDefinitionTypeAppendixReference(app));
      } else {
        throw new RuntimeException("Unparsable: " + html);
      }
      pos = html.indexOf('<');
    }
    if (html.length() > 0)
      result.getContent().add(parseHTML(html));
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.