Package org.megatome.frame2.jaxbgen

Examples of org.megatome.frame2.jaxbgen.ObjectFactory


    @Test
    public void testTemplatePluginSingleLoadDefaultDir() {
        TemplateConfigurationInterface config = testTemplatePlugin(null);

        TemplateDefI def = config.getDefinition("foo"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$
        assertTrue(def.getPutParams().isEmpty());

        def = config.getDefinition("bar"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$
        Map<String, String> params = def.getPutParams();
        assertTrue(params.size() == 1);
        assertNotNull(params.get("bar-put")); //$NON-NLS-1$
        assertTrue(params.get("bar-put").equals("yyy.jsp")); //$NON-NLS-1$ //$NON-NLS-2$

        def = config.getDefinition("baz"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$
        assertTrue(def.getPutParams().isEmpty());
    }
View Full Code Here


    @Test
    public void testTemplatePluginSingleLoad() {
        TemplateConfigurationInterface config = testTemplatePlugin("/templates/good/single/"); //$NON-NLS-1$

        TemplateDefI def = config.getDefinition("foo"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$

        Map<String, String> params = def.getPutParams();
        assertTrue(params.size() == 1);
        assertNotNull(params.get("yyy")); //$NON-NLS-1$
        assertTrue(params.get("yyy").equals("yyy.jsp")); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      dbf.setValidating(true);
     
      this.documentBuilder = dbf.newDocumentBuilder();
      this.documentBuilder.setErrorHandler(new Frame2ParseErrorHandler());
      this.documentBuilder.setEntityResolver(new Frame2EntityResolver());
   }
View Full Code Here

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(true);

    this.documentBuilder = dbf.newDocumentBuilder();
    this.documentBuilder.setErrorHandler(new Frame2ParseErrorHandler());
    this.documentBuilder.setEntityResolver(new Frame2EntityResolver());
  }
View Full Code Here

   public void setUp() throws Exception {
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      dbf.setValidating(true);
     
      this.documentBuilder = dbf.newDocumentBuilder();
      this.documentBuilder.setErrorHandler(new Frame2ParseErrorHandler());
      this.documentBuilder.setEntityResolver(new Frame2EntityResolver());
   }
View Full Code Here

    public TemplateConfigReader(Map<String, TemplateDefI> definitions) {
        this.putTagHandler = new PutParamTagHandler();
        this.templateTagHandler = new TemplateTagHandler(this.putTagHandler,
                definitions);
        this.reader = new Frame2SAXReader();

        this.reader.setElementHandler(TEMPLATE, this.templateTagHandler);
        this.reader.setElementHandler(PUT, this.putTagHandler);

        // Now set the Elements which do not have handlers
View Full Code Here

     * then parses the file.
     * @exception Frame2Exception
     */
    public void execute() throws Frame2Exception {
        try {
            Frame2SAXReader reader = new Frame2SAXReader();

            reader.setElementHandler(FORWARD, this.forwardTagHandler);
            reader.setElementHandler(EVENT, this.eventTagHandler);
            reader.setElementHandler(SCHEMA_MAPPING, this.schemaMappingTagHandler);
            reader.setElementHandler(EVENT_NAME, this.eventNameTagHandler);
            reader.setElementHandler(EVENT_MAPPING, this.eventMappingTagHandler);
            reader.setElementHandler(HANDLER, this.handlerTagHandler);
            reader.setElementHandler(VIEW, this.viewTagHandler);
            reader.setElementHandler(SECURITY, this.securityTagHandler);
            reader.setElementHandler(ROLE, this.roleTagHandler);
            reader.setElementHandler(GLOBAL_FORWARDS, this.globalForwardTagHandler);
            reader.setElementHandler(EVENT_HANDLER, this.eventHandlerTagHandler);
            reader.setElementHandler(INPUT_PARAM, this.inputParamTagHandler);
            reader.setElementHandler(EXCEPTION, this.exceptionTagHandler);
            reader.setElementHandler(PLUGIN, this.pluginTagHandler);
            reader.setElementHandler(SOAP_REQ_PROC, this.soapReqProcHandler);
            reader.setElementHandler(HTTP_REQ_PROC, this.httpReqProcHandler);

            // Now set the Elements which do not have handlers
            reader.setElement(FRAME2_CONFIG);
            reader.setElement(EVENTS);
            reader.setElement(SCHEMA_MAPPINGS);
            reader.setElement(EVENT_MAPPINGS);
            reader.setElement(EVENT_HANDLERS);
            reader.setElement(EXCEPTIONS);
            reader.setElement(PLUGINS);
            reader.setElement(REQ_PROC);

            if (this.is == null) {
                throw new ParserException("Error finding config file "); //$NON-NLS-1$
            }

            reader.parse(this.is);
        } catch (ParserException e) {
            throw new Frame2Exception("Unable to load configuration", e); //$NON-NLS-1$
        }
    }
View Full Code Here

        String forwardName = attributes.getValue(FORWARD_NAME);
        String viewattr = attributes.getValue(TYPE);
        ViewType vtype = ViewType.fromString(viewattr);

        if (vtype == null) {
            throw new ParserException(INVALID_TYPE + forwardName + " type " //$NON-NLS-1$
                    + viewattr);
        }

        if (vtype.equals(ViewType.BOTH)) {
            this.htmlForwardName = forwardName;
View Full Code Here

            Attributes attributes) throws ParserException {
        String requestKey = attributes.getValue(REQUEST_KEY);
        String type = attributes.getValue(TYPE);
        this.def = new ExceptionDef(requestKey, type);
        if (this.exceptions.contains(this.def)) {
            throw new ParserException(
                    "Exception tag Error, Duplicate type defined for type " //$NON-NLS-1$
                            + type);
        }
    }
View Full Code Here

  String localName, @SuppressWarnings("unused")
  String qName,
            Attributes attributes) throws ParserException {
        String name = attributes.getValue(NAME);
        if (this.params.containsKey(name)) {
            throw new ParserException("Duplicate name in put parameter " + name); //$NON-NLS-1$
        }

        this.params.put(name, attributes.getValue(PATH));
    }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.jaxbgen.ObjectFactory

Copyright © 2018 www.massapicom. 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.