Package com.volantis.xml.namespace

Examples of com.volantis.xml.namespace.ExpandedName


     * Tests the {@link AbstractAddAdapterRule#startElement} method
     * @throws Exception if an error occurs
     */
    public void testStartElement() throws Exception {
        // create an expanded name       
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");
        Attributes atts = new AttributesImpl();       
       
        XMLPipeline pipeline = dynamicProcess.getPipeline();       
       
View Full Code Here


        // retrieve the pipeline
        XMLPipeline pipeline = dynamicProcess.getPipeline();
        // add a process to the head of the pipeline       
        pipeline.addHeadProcess(adapterProcess);
           
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");
   
        // call end element on the rule
        rule.endElement(dynamicProcess, eName, adapterProcess);
       
View Full Code Here

        XMLPipeline pipeline = dynamicProcess.getPipeline();
        // add the process to the head of the pipeline       
        pipeline.addHeadProcess(adapterProcess);       
       
        // create an expanded name       
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");
       
        try {
            // call end element on the rule
            rule.endElement(dynamicProcess, eName, new MockAdapterProcess());
View Full Code Here

     * Tests the {@link AbstractAddProcessRule#startElement} method
     * @throws Exception if an error occurs
     */
    public void testStartElement() throws Exception {
        // create an expanded name       
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");

        Attributes atts = createStartElementAttributes();

        XMLPipeline pipeline = dynamicProcess.getPipeline();                      
View Full Code Here

    public void testEndElement() throws Exception {
        // retrieve the pipeline
        XMLPipeline pipeline = dynamicProcess.getPipeline();

        // create an expanded name
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");

        // ask the rule to create a process
        XMLProcess process = rule.createProcess(dynamicProcess,
                                                eName,
View Full Code Here

        XMLPipeline pipeline = dynamicProcess.getPipeline();
        // add the process to the head of the pipeline       
        pipeline.addHeadProcess(new XMLProcessTestable());
       
        // create an expanded name       
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");

        try {
            // call end element on the rule
            rule.endElement(dynamicProcess, eName, new XMLProcessTestable());
View Full Code Here

        // pass in null if no prefix is specified. Ensure we replace null
        // strings with empty strings.
        if (namespace == null) {
            namespace = "";
        }
        ExpandedName eName = namespacePrefixTracker.resolveQName(
                new ImmutableQName(namespace, name), "");

        return (Function)functions.get(eName);
    }
View Full Code Here

        String localName = null;
        final String property = ElementUtils.getAttributeValue(context,
            attributes, XDIMESchemata.XHTML2_NAMESPACE, ATTR_NAME_PROPERTY);

        final ExpandedName name = getAsExpandedName(property, context);
        if (name != null) {
            if (XDIMESchemata.XDIME2_MCS_NAMESPACE.equals(name.getNamespaceURI())
                    || XDIMESchemata.DC_NAMESPACE.equals(name.getNamespaceURI())
                    || "".equals(name.getNamespaceURI())){
                // only set the result if the property has the right
                // namespace. It might be mcs, dc or default (empty) namespace
                localName = name.getLocalName();
            }           
        } else {
            throw new XDIMEException(LOCALIZER.format(
                    "illegal-meta-data-property-missing"));
        }
View Full Code Here

    }

    private ImmutableExpandedName getAsExpandedName(
            final String string, final XDIMEContextInternal context) {

        ExpandedName name;
        if (string != null && string.length() > 0) {
            ImmutableQName qName = new ImmutableQName(string);
            NamespacePrefixTracker tracker = context.getExpressionContext().
                    getNamespacePrefixTracker();
            name = tracker.resolveQName(qName, "");
        } else {
            name = null;
        }

        final ImmutableExpandedName result;
        if (name == null) {
            result = null;
        } else {
            result = name.getImmutableExpandedName();
        }
        return result;
    }
View Full Code Here

     * @param listenerEvent the event to map.
     */
    public void mapEventToAttributes(
            ListenerEvent listenerEvent) {

        ExpandedName eventType = listenerEvent.getEventType();
        Mapper mapper = (Mapper) eventType2SetterMap.get(eventType);
        if (mapper != null) {
            ScriptAssetReference handlerScript =
                    listenerEvent.getHandlerScript();
            mapper.map(handlerScript, eventAttributes);
View Full Code Here

TOP

Related Classes of com.volantis.xml.namespace.ExpandedName

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.