Examples of Namespace


Examples of org.opensaml.xml.Namespace

     * @param attribute the namespace decleration attribute
     */
    protected void unmarshallNamespaceAttribute(XMLObject xmlObject, Attr attribute) {
        log.trace("{} is a namespace declaration, adding it to the list of namespaces on the XMLObject", XMLHelper
                .getNodeQName(attribute));
        Namespace namespace;
        if(DatatypeHelper.safeEquals(attribute.getLocalName(), XMLConstants.XMLNS_PREFIX)){
            namespace = new Namespace(attribute.getValue(), null);
        }else{
            namespace = new Namespace(attribute.getValue(), attribute.getLocalName());
        }
        namespace.setAlwaysDeclare(true);
        xmlObject.getNamespaceManager().registerNamespaceDeclaration(namespace);
    }
View Full Code Here

Examples of org.pdf4j.saxon.instruct.Namespace

    protected String getErrorCodeForSelectPlusContent() {
        return "XTSE0910";
    }

    public Expression compile(Executable exec) throws XPathException {
        Namespace inst = new Namespace(name);
        compileContent(exec, inst, new StringLiteral(StringValue.SINGLE_SPACE));
        return inst;
    }
View Full Code Here

Examples of org.renjin.primitives.packaging.Namespace

  @Ignore("todo")
  @Test
  public void test() throws Exception {
   
    Context tlContext = Context.newTopLevelContext();
    Namespace ns = tlContext.getNamespaceRegistry().createNamespace(new TestPackage());
   
    Context ctx = tlContext.beginEvalContext(ns.getNamespaceEnvironment());
    ctx.evaluate(RParser.parseSource("f <- function(x) x*x*42\n"));
   
    File envFile = File.createTempFile("nstest", ".RData");
    envFile.deleteOnExit();
   
    LazyLoadFrameBuilder builder = new LazyLoadFrameBuilder(tlContext);
    builder.outputTo(envFile);
    builder.build(ns.getNamespaceEnvironment());
   
    // now reload into a new context
    tlContext = Context.newTopLevelContext();
    tlContext.getNamespaceRegistry().createNamespace(new TestPackage());
   
View Full Code Here

Examples of org.springframework.ws.server.endpoint.annotation.Namespace

            for (Namespace namespaceAnn : namespacesAnn.value()) {
                namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri());
            }
        }
        if (annotatedElement.isAnnotationPresent(Namespace.class)) {
            Namespace namespaceAnn = annotatedElement.getAnnotation(Namespace.class);
            namespaceContext.bindNamespaceUri(namespaceAnn.prefix(), namespaceAnn.uri());
        }
    }
View Full Code Here

Examples of org.stjs.javascript.annotation.Namespace

  public boolean isGlobal() {
    return getAnnotation(GlobalScope.class) != null;
  }

  public String getNamespace() {
    Namespace ns = element.getAnnotation(Namespace.class);
    if (ns != null) {
      return ns.value();
    }
    return null;
  }
View Full Code Here

Examples of org.teiid.query.mapping.xml.Namespace

       
        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
        root.setSource("vm1.g1"); //$NON-NLS-1$
        root.addAttribute(new MappingAttribute("type", new Namespace("xsi", ""))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        root.addAttribute(new MappingAttribute("type", "vm1.g1.e1")); //$NON-NLS-1$ //$NON-NLS-2$
        root.addChildElement(new MappingElement("myElement", "vm1.g1.e2")); //$NON-NLS-1$ //$NON-NLS-2$       
        return doc;
   }
View Full Code Here

Examples of org.wikipediacleaner.api.data.Namespace

    if (analysis == null) {
      return false;
    }

    // Check category name space
    Namespace categoryNamespace = analysis.getWikiConfiguration().getNamespace(Namespace.CATEGORY);
    if (categoryNamespace == null) {
      return false;
    }
    String preferredCategory = categoryNamespace.getTitle();
    if (preferredCategory == null) {
      preferredCategory = PageElementCategory.DEFAULT_NAME;
    }

    // Check every category
View Full Code Here

Examples of org.wildfly.extension.picketlink.federation.Namespace

    @Override
    public void readElement(XMLExtendedStreamReader reader, List<ModelNode> addOperations) throws XMLStreamException {
        requireNoAttributes(reader);

        Namespace nameSpace = Namespace.forUri(reader.getNamespaceURI());

        ModelNode subsystemNode = createSubsystemRoot();

        addOperations.add(subsystemNode);
View Full Code Here

Examples of org.wildfly.extension.picketlink.idm.Namespace

    @Override
    public void readElement(XMLExtendedStreamReader reader, List<ModelNode> addOperations) throws XMLStreamException {
        requireNoAttributes(reader);

        Namespace nameSpace = Namespace.forUri(reader.getNamespaceURI());

        ModelNode subsystemNode = createSubsystemRoot();

        addOperations.add(subsystemNode);
View Full Code Here

Examples of org.zkoss.idom.Namespace

   */
  private void parse(PageDefinition pgdef, NodeInfo parent,
  Element el, AnnotationHelper annHelper, boolean bNativeContent)
  throws Exception {
    final String nm = el.getLocalName();
    final Namespace ns = el.getNamespace();
    final String pref = ns != null ? ns.getPrefix(): "";
    final String uri = ns != null ? ns.getURI(): "";
    LanguageDefinition langdef = pgdef.getLanguageDefinition();
    if ("zscript".equals(nm) && isZkElement(langdef, nm, pref, uri)) {
      parseZScript(parent, el, annHelper);
    } else if ("attribute".equals(nm) && isZkElement(langdef, nm, pref, uri)) {
      if (!(parent instanceof ComponentInfo))
        throw new UiException("<attribute> cannot be the root element, "+el.getLocator());

      parseAttribute(pgdef, (ComponentInfo)parent, el, annHelper);
    } else if ("custom-attributes".equals(nm) && isZkElement(langdef, nm, pref, uri)) {
      parseCustomAttributes(langdef, parent, el, annHelper);
    } else if ("variables".equals(nm) && isZkElement(langdef, nm, pref, uri)) {
      parseVariables(langdef, parent, el, annHelper);
    } else if (LanguageDefinition.ANNO_NAMESPACE.equals(uri)
    || "annotation".equals(uri)) {
      parseAnnotation(el, annHelper);
    } else {
      //if (D.ON && log.debugable()) log.debug("component: "+nm+", ns:"+ns);
      final ComponentInfo compInfo;
      final boolean bzk =
        "zk".equals(nm) && isZkElement(langdef, nm, pref, uri);
      if (bzk) {
        if (annHelper.clear())
          log.warning("Annotations are ignored since <zk> doesn't support them, "+el.getLocator());
        compInfo = new ZkInfo(parent);
      } else {
        if (isZkSwitch(parent))
          throw new UiException("Only <zk> can be used in <zk switch>, "+el.getLocator());

        boolean prefRequired =
          uri.startsWith(LanguageDefinition.NATIVE_NAMESPACE_PREFIX);
        boolean bNative = bNativeContent || prefRequired
          || LanguageDefinition.NATIVE_NAMESPACE.equals(uri)
          || "native".equals(uri);

        if (!bNative && langdef.isNative()
        && !langdef.getNamespace().equals(uri))
          bNative = prefRequired =
            ("".equals(pref) && "".equals(uri))
            || !LanguageDefinition.exists(uri);
          //Spec: if pref/URI not specified => native
          //    if uri unknown => native

        if (bNative) {
          if (annHelper.clear())
            log.warning("Annotations are ignored since native doesn't support them, "+el.getLocator());

          final NativeInfo ni;
          compInfo = ni = new NativeInfo(
            parent, langdef.getNativeDefinition(),
            prefRequired && pref.length() > 0 ? pref + ":" + nm: nm);

          //add declared namespace if starting with native:
          final Collection dns = el.getDeclaredNamespaces();
          if (!dns.isEmpty())
            addDeclaredNamespace(ni, dns, langdef);
        } else {
          final boolean defaultNS = isDefaultNS(langdef, pref, uri);
          final LanguageDefinition complangdef =
            defaultNS ? langdef: LanguageDefinition.lookup(uri);
          ComponentDefinition compdef =
            defaultNS ? pgdef.getComponentDefinitionMap().get(nm): null;
          if (compdef != null) {
            compInfo = new ComponentInfo(parent, compdef);
          } else if (complangdef.hasComponentDefinition(nm)) {
            compdef = complangdef.getComponentDefinition(nm);
            compInfo = new ComponentInfo(parent, compdef);
            langdef = complangdef;
          } else {
            compdef = complangdef.getDynamicTagDefinition();
            if (compdef == null)
              throw new DefinitionNotFoundException("Component definition not found: "+nm+" in "+complangdef+", "+el.getLocator());
            compInfo = new ComponentInfo(parent, compdef, nm);
            langdef = complangdef;
          }

          //process use first because addProperty needs it
          String use = el.getAttributeValue("use");
          if (use != null) {
            use = use.trim();
            if (use.length() != 0)
              compInfo.setImplementation(use);
              //Resolve later since might defined in zscript
          }
        }
      }

      String ifc = null, unless = null,
        forEach = null, forEachBegin = null, forEachEnd = null;
      AnnotationHelper attrAnnHelper = null;
      for (Iterator it = el.getAttributeItems().iterator();
      it.hasNext();) {
        final Attribute attr = (Attribute)it.next();
        final Namespace attrns = attr.getNamespace();
        final String attURI = attrns != null ? attrns.getURI(): "";
        final String attnm = attr.getLocalName();
        final String attval = attr.getValue();
        if (LanguageDefinition.ANNO_NAMESPACE.equals(attURI)
        || "annotation".equals(attURI)) {
          if (bzk) warnWrongZkAttr(attr);
          else {
            if (attrAnnHelper == null)
              attrAnnHelper = new AnnotationHelper();
            attrAnnHelper.addByRawValue(attnm, attval);
          }
        } else if ("apply".equals(attnm) && isZkAttr(langdef, attrns)) {
          if (bzk) warnWrongZkAttr(attr);
          else compInfo.setApply(attval);
        } else if ("forward".equals(attnm) && isZkAttr(langdef, attrns)) {
          if (bzk) warnWrongZkAttr(attr);
          else compInfo.setForward(attval);
        } else if ("if".equals(attnm) && isZkAttr(langdef, attrns)) {
          ifc = attval;
        } else if ("unless".equals(attnm) && isZkAttr(langdef, attrns)) {
          unless = attval;
        } else if ("forEach".equals(attnm) && isZkAttr(langdef, attrns)) {
          forEach = attval;
        } else if ("forEachBegin".equals(attnm) && isZkAttr(langdef, attrns)) {
          forEachBegin = attval;
        } else if ("forEachEnd".equals(attnm) && isZkAttr(langdef, attrns)) {
          forEachEnd = attval;
        } else if ("fulfill".equals(attnm) && isZkAttr(langdef, attrns)) {
          if (bzk) warnWrongZkAttr(attr);
          else compInfo.setFulfill(attval);
        } else if (bzk) {
          if ("switch".equals(attnm) || "choose".equals(attnm)) {
            if (isZkSwitch(parent))
              throw new UiException("<zk "+attnm+"> cannot be used in <zk switch/choose>, "+el.getLocator());
            ((ZkInfo)compInfo).setSwitch(attval);
          } else if ("case".equals(attnm)) {
            if (!isZkSwitch(parent))
              throw new UiException("<zk case> can be used only in <zk switch>, "+attr.getLocator());
            ((ZkInfo)compInfo).setCase(attval);
          } else if ("when".equals(attnm)) {
            ifc = attval;
          } else {
            final String attPref = attrns != null ? attrns.getPrefix(): null;
            if (!"xmlns".equals(attnm) && !"xml".equals(attnm)
            && attURI.indexOf("w3.org") < 0
            && (attPref == null
             || (!"xmlns".equals(attPref) && !"xml".equals(attPref))))
              warnWrongZkAttr(attr);
          }
        } else if (!("use".equals(attnm) && isZkAttr(langdef, attrns))) {
          final String attPref = attrns != null ? attrns.getPrefix(): "";
          if (!"xmlns".equals(attPref)
          && !("xmlns".equals(attnm) && "".equals(attPref))
          && !"http://www.w3.org/2001/XMLSchema-instance".equals(attURI)) {
            if (isAttrAnnot(attval)) { //annotation
              if (attrAnnHelper == null)
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.