Package org.milyn.cdr

Examples of org.milyn.cdr.SmooksResourceConfiguration$ContextIndex


        if(saxVisitorMap == null) {
            return;
        }

        for(ContentHandlerConfigMap<? extends SAXVisitor> contentHandlerMap : saxVisitorMap) {
            SmooksResourceConfiguration resourceConfig = contentHandlerMap.getResourceConfig();
            SelectorStep[] selectorSteps = resourceConfig.getSelectorSteps();
            List<IndexEvaluator> indexEvaluators = new ArrayList<IndexEvaluator>();

            for(SelectorStep selectorStep : selectorSteps) {
                indexEvaluators.clear();
                selectorStep.getEvaluators(IndexEvaluator.class, indexEvaluators);
View Full Code Here


        if(vbs == null) {
            vbs = new ArrayList<ContentHandlerConfigMap<SAXVisitBefore>>();
            visitorMap.setVisitBefores(vbs);
        }

        SmooksResourceConfiguration resourceConfig = new SmooksResourceConfiguration(targetElementName);

        if(targetNS != null && targetNS != XMLConstants.NULL_NS_URI) {
            resourceConfig.setSelectorNamespaceURI(targetNS);
        }

        vbs.add(0, new ContentHandlerConfigMap(indexCounter, resourceConfig));
    }
View Full Code Here

      // If any of the selector steps need access to the fragment text...
        if(visitAfters == null) {
            return;
        }
        for(ContentHandlerConfigMap<? extends SAXVisitor> contentHandlerMap : visitAfters) {
            SmooksResourceConfiguration resourceConfig = contentHandlerMap.getResourceConfig();
            SelectorStep selectorStep = resourceConfig.getSelectorStep();

            if(selectorStep.accessesText()) {
                accumulateText = true;
                break;
            }
View Full Code Here

    /**
     * Iterate over the table applying the strategy.
     */
    private void iterate() {
            for (int i = 0; i < resourceConfigsList.size(); i++) {
                SmooksResourceConfiguration smooksResourceConfiguration = resourceConfigsList.get(i);
                strategy.applyStrategy(smooksResourceConfiguration.getTargetElement(), smooksResourceConfiguration);
            }
    }
View Full Code Here

                if(applicationContext == null) {
                    throw new IllegalStateException("Call to getObjects() before the setApplicationContext() was called.");
                }

                for(int i = 0; i < unitDefs.size(); i++) {
                    SmooksResourceConfiguration resConfig = (SmooksResourceConfiguration)unitDefs.get(i);
                    objects.add(applicationContext.getStore().getObject(resConfig));
                }
            } else {
                objects = EMPTY_LIST;
            }
View Full Code Here

    private <T extends Visitor> FilterBypass getFilterBypass(ContentHandlerConfigMapTable<T> visitorTable) {
        Set<Entry<String, List<ContentHandlerConfigMap<T>>>> entries = visitorTable.getTable().entrySet();
       
        for(Entry<String, List<ContentHandlerConfigMap<T>>> entry : entries) {
          ContentHandlerConfigMap<T> configMap = entry.getValue().get(0);
          SmooksResourceConfiguration resourceConfig = configMap.getResourceConfig();
         
          if(!resourceConfig.isDefaultResource()) {
            if(resourceConfig.getTargetElement().equals(SmooksResourceConfiguration.DOCUMENT_FRAGMENT_SELECTOR)) {
              T visitor = configMap.getContentHandler();
              if(visitor instanceof FilterBypass) {
                return (FilterBypass) visitor;
              }
            }
View Full Code Here

    }

    private void applyAssemblyBefores(Element element, List<ContentHandlerConfigMap<DOMVisitBefore>> assemblyBefores) {
        for (int i = 0; i < assemblyBefores.size(); i++) {
            ContentHandlerConfigMap<DOMVisitBefore> configMap = assemblyBefores.get(i);
            SmooksResourceConfiguration config = configMap.getResourceConfig();

            // Make sure the assembly unit is targeted at this element...
            if (!config.isTargetedAtElement(element, executionContext)) {
                continue;
            }

            // Register the targeting event.  No need to register it again in the visitAfter loop...
            if (eventListener != null) {
View Full Code Here

            }
        }
    }

    private void applyAssemblyAfter(Element element, ContentHandlerConfigMap<DOMVisitAfter> configMap) {
        SmooksResourceConfiguration config = configMap.getResourceConfig();

        // Make sure the assembly unit is targeted at this element...
        if (!config.isTargetedAtElement(element, executionContext)) {
            return;
        }

        DOMVisitAfter visitAfter = configMap.getContentHandler();
        try {
View Full Code Here

                }
            }
        }

        private void processMapping(ExecutionContext executionContext, ContentHandlerConfigMap configMap, VisitSequence visitSequence) {
            SmooksResourceConfiguration config = configMap.getResourceConfig();

            // Make sure the processing unit is targeted at this element...
            if (!config.isTargetedAtElement(element, executionContext)) {
                return;
            }

            // Could add an "is-element-in-document-tree" check here
            // but might not be valid.  Also, this check
View Full Code Here

    sortSmooksResourceConfigurations(resourceConfigTable);

    // If there's a DTD for this device, get it and add it to the DTDStore.
    List dtdSmooksResourceConfigurations = resourceConfigTable.get("dtd");
    if(dtdSmooksResourceConfigurations != null && dtdSmooksResourceConfigurations.size() > 0) {
            SmooksResourceConfiguration dtdSmooksResourceConfiguration = (SmooksResourceConfiguration)dtdSmooksResourceConfigurations.get(0);
            byte[] dtdDataBytes = dtdSmooksResourceConfiguration.getBytes();

            if(dtdDataBytes != null) {
                DTDStore.addDTD(profileSet, new ByteArrayInputStream(dtdDataBytes));
                // Initialise the DTD reference for this config table.
                dtd = DTDStore.getDTDObject(profileSet);
            } else {
                logger.error("DTD resource [" + dtdSmooksResourceConfiguration.getResource() + "] not found in classpath.");
            }
    }

    // Expand the SmooksResourceConfiguration table and resort
    expandSmooksResourceConfigurationTable();
View Full Code Here

TOP

Related Classes of org.milyn.cdr.SmooksResourceConfiguration$ContextIndex

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.