Examples of Namespace


Examples of javax.script.Namespace


    // Implementation methods
    //-------------------------------------------------------------------------
    protected void process(MessageExchange exchange, NormalizedMessage message) throws MessagingException {
        Namespace namespace = engine.createNamespace();
       
        populateNamespace(namespace, exchange, message);

        try {
            runScript(namespace);
            if (isInAndOut(exchange)) {
                // nothing to do: out message will be sent
            } else if (!isDisableOutput()) {
                InOnly outExchange = (InOnly) namespace.get("outExchange");
                getDeliveryChannel().sendSync(outExchange);
                exchange.setStatus(ExchangeStatus.DONE);
            } else {
                exchange.setStatus(ExchangeStatus.DONE);
            }
View Full Code Here

Examples of javax.xml.stream.events.Namespace

  public org.dom4j.Namespace readNamespace(XMLEventReader reader)
      throws XMLStreamException {
    XMLEvent event = reader.peek();

    if (event.isNamespace()) {
      Namespace ns = (Namespace) reader.nextEvent();

      return createNamespace(ns);
    } else {
      throw new XMLStreamException("Expected Namespace event, found: "
          + event);
View Full Code Here

Examples of mf.javax.xml.stream.events.Namespace

        super(isStartElement ? START_ELEMENT : END_ELEMENT, location);
        fName = name;
        if (namespaces != null && namespaces.hasNext()) {
            fNamespaces = new ArrayList();
            do {
                Namespace ns = (Namespace) namespaces.next();
                fNamespaces.add(ns);
            }
            while (namespaces.hasNext());
        }
        else {
View Full Code Here

Examples of mfinder.annotation.Namespace

     *
     * @return Action代理对象。
     */
    private ActionProxy createActionProxy(Method method, Object obj) throws IllegalAccessException,
            InvocationTargetException {
        Namespace ns = method.getDeclaringClass().getAnnotation(Namespace.class);
        //trim empay and '/'
        String namespace = ns == null ? PATH_SEPARATOR + "" : PATH_SEPARATOR + StringUtil.trim(ns.name(), PATH_SEPARATOR);

        String path = null;
        //not nullable Action
        Action action = method.getAnnotation(Action.class);
        //Action名称可能为空字符串
        String aname = action.name().trim();
        if ("".equals(aname)) {
            //Action名称为空字符串时取其方法的名称(区分大小写)
            aname = method.getName();
            //if namespace is '/' or not
            path = namespace.length() == 1 ? PATH_SEPARATOR + aname : namespace + PATH_SEPARATOR + aname;
        } else {
            //action's name can't be null by annotation
            String name = StringUtil.trim(aname, PATH_SEPARATOR);
            //if action's name is trim as empty
            if (name.isEmpty()) {
                path = namespace;
            } else if (PATH_SEPARATOR == aname.charAt(0)) {
                path = PATH_SEPARATOR + name;
            } else {
                //if namespace is '/' or not
                path = namespace.length() == 1 ? PATH_SEPARATOR + name : namespace + PATH_SEPARATOR + name;
            }
        }

        //包含特别属性注入的Action需重新生成对象
        if (obj != null && Injector.actionInjection.containsKey(path)) {
            obj = objectFactory.newInstance(obj.getClass());
            Injector.injectAction(path, obj);
        }

        //Action中不记录路径的后缀名称
        ActionProxy ap = new ActionProxy(this, namespace, path, action, method, obj);

        //interceptorStack
        String stackName = action.interceptorStack().trim();
        //not not nullable action's interceptors
        String[] interceptorNames = action.interceptors();

        List<InterceptorProxy> inters = new ArrayList<InterceptorProxy>();
        //action interceptors
        if (interceptorNames.length != 0) {
            ////action interceptorStack
            if (StringUtil.isNotNull(stackName)) {
                addActionInterceptors(inters, stackName, ap);
            }
            //action中申明的interceptors
            for (String name : action.interceptors()) {
                InterceptorProxy ip = interceptors.get(name);
                if (ip == null) {
                    LOG.warn("No such Interceptor [" + name + "] defined in : " + ap.getMethodInfo());
                } else {
                    inters.add(ip);
                }
            }
        } //action interceptorStack
        else if (StringUtil.isNotNull(stackName)) {
            addActionInterceptors(inters, stackName, ap);
        } else {
            //是否已设置action的拦截器集合
            boolean setInterceptors = false;
            //namespace interceptorStack & interceptors
            if (ns != null) {
                //namespace interceptorStack
                if (StringUtil.isNotNull(stackName = ns.interceptorStack().trim())) {
                    setInterceptors = true;
                    addActionInterceptors(inters, stackName, ap);
                }
                //namespace interceptors
                if (ns.interceptors().length != 0) {
                    setInterceptors = true;
                    for (String name : ns.interceptors()) {
                        InterceptorProxy ip = interceptors.get(name);
                        if (ip == null) {
                            LOG.warn("No such Interceptor [" + name + "] defined in : " + ap.getMethodInfo());
                        } else {
                            inters.add(ip);
View Full Code Here

Examples of net.sf.laja.template.Namespace

    return new Call(source, template.getContext(), namespaces, templateTextWriter);
  }

  @Override
  public INamespace createNamespace() {
    return new Namespace(namespaces);
  }
View Full Code Here

Examples of net.sf.saxon.instruct.Namespace

        select = typeCheck("select", select);
        super.validate();
    }

    public Expression compile(Executable exec) throws TransformerConfigurationException {
        Namespace inst = new Namespace(name);
        compileContent(exec, inst);
        ExpressionTool.makeParentReferences(inst);
        return inst;
    }
View Full Code Here

Examples of net.sourceforge.argparse4j.inf.Namespace

    }

    @Override
    public Namespace parseArgsOrFail(String args[]) {
        try {
            Namespace ns = parseArgs(args);
            return ns;
        } catch (ArgumentParserException e) {
            handleError(e);
            System.exit(1);
        }
View Full Code Here

Examples of net.sourceforge.retroweaver.translator.NameSpace

          System.exit(1);
        }
      } else if (command.equals("-namespace")) {
        String oldPrefix = args[currentArg++];
        String newPrefix = args[currentArg++];
        NameSpace n = new NameSpace(oldPrefix, newPrefix);
        namespaces.add(n);
      } else if (command.equals("-version")) {
        System.out.println("Retroweaver version " + getVersion()); // NOPMD by xlv
        System.exit(0);
      } else if (command.equals("-target")) {
View Full Code Here

Examples of net.tralfamadore.cmf.Namespace

    @Mocked
    PageContent pageContent;

    @Test
    public void testStart() throws Exception {
        final Namespace parent = Namespace.createFromString("net.tralfamadore");

        new NonStrictExpectations() {
            {
                pageContent.getNamespace(); result = new Delegate() {
                    Namespace returnANamespace() {
                        return parent;
                    }
                };
                pageContent.getNamespaceToAdd(); result = Namespace.createFromString("net.tralfamadore.site");
            }
        };

        adminController.addNewNamespace();

        new Verifications() {
            {
                pageContent.getNamespace(); times = 1;
                pageContent.setNamespaceToAdd(new Namespace(parent, "")); times = 1;
                pageContent.getNamespaceToAdd(); times = 1;
                pageContent.setAddingNamespace(anyBoolean); times = 1;
                forEachInvocation = new Object() {
                    void validate(boolean b) {
                        assertTrue(b);
View Full Code Here

Examples of nu.xom.Namespace

       
        Element parent = new Element("Test", "http://www.example.org");
       
        Nodes result = parent.query("namespace::*");
        assertEquals(2, result.size());
        Namespace n1 = (Namespace) result.get(0);
        Namespace n2 = (Namespace) result.get(1);
        assertTrue(n1.getPrefix().equals("") || n2.getPrefix().equals(""));
        assertTrue(n1.getPrefix().equals("xml") || n2.getPrefix().equals("xml"));
        assertTrue(n1.getValue().equals("http://www.example.org")
          || n2.getValue().equals("http://www.example.org"));
        assertTrue(n1.getValue().equals(Namespace.XML_NAMESPACE)
          || n2.getValue().equals(Namespace.XML_NAMESPACE));
       
    }
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.