public static int getColumnLocation(Element element) { return LocationAttributes.getColumn(element); }
public static int getLineLocation(Element element) { return LocationAttributes.getLine(element); }
public static Location getLocationObject(Element element) { return LocationAttributes.getLocation(element); }
public static String getSystemIdLocation(Element element) { return LocationAttributes.getURI(element); }
/** * Returns the content of the given Element as an object implementing the * XMLizable interface. Practically speaking, the implementation uses the * {@link SaxBuffer} class. The XMLizable object will be a standalone blurb * of SAX events, not producing start/endDocument calls and containing all * necessary namespace declarations. */ public static XMLizable compileElementContent(Element element) { // Remove location information LocationAttributes.remove(element, true); SaxBuffer saxBuffer = new SaxBuffer(); DOMStreamer domStreamer = new DOMStreamer(); domStreamer.setContentHandler(saxBuffer); NodeList childNodes = element.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { try { domStreamer.stream(childNodes.item(i)); } catch (SAXException e) { // It's unlikely that an exception will occur here, // so use a runtime exception throw new RuntimeException("Error in DomHelper.compileElementContent: " + e.toString()); } } return saxBuffer; }
/** * Retrieves the location of an element node in the source file from which * the Document was created. This will only work for Document's created * with the method {@link #parse(InputSource, ServiceManager)} of this class. */ public static String getLocation(Element element) { return LocationAttributes.getLocationString(element); }
public void buildLibrary(Element libraryElement) throws Exception { sourceURI = LocationAttributes.getURI(libraryElement); Element widgetsElement = DomHelper.getChildElement(libraryElement, FormsConstants.DEFINITION_NS, "widgets", true); WidgetDefinitionBuilderContext context = new WidgetDefinitionBuilderContext(this); // All child elements of the widgets element are widgets Element[] widgetElements = DomHelper.getChildElements(widgetsElement, FormsConstants.DEFINITION_NS); for (int i = 0; i < widgetElements.length; i++) { Element widgetElement = widgetElements[i]; buildWidgetDefinition(widgetElement, context); } }
LocationAttributes.remove(selectionListElement, true);
public void buildLibrary(Element libraryElement) throws Exception { sourceURI = LocationAttributes.getURI(libraryElement); this.assistant.getContext().setLocalLibrary(this); Element[] bindingElements = DomHelper.getChildElements(libraryElement, BindingManager.NAMESPACE); for (int i = 0; i < bindingElements.length; i++) { Element bindingElement = bindingElements[i]; Binding binding = this.assistant.getBindingForConfigurationElement(bindingElement); addBinding(binding); } }
Node node = nested.item(i).cloneNode(true); if (node.getNodeType() == Node.ELEMENT_NODE) { LocationAttributes.remove((Element) node, true);
public WidgetDefinition buildWidgetDefinition(Element formElement) throws Exception { FormDefinition formDefinition = new FormDefinition(libraryManager); WidgetDefinitionBuilderContext context = new WidgetDefinitionBuilderContext(formDefinition.getLocalLibrary()); // set local URI formDefinition.getLocalLibrary().setSourceURI(LocationAttributes.getURI(formElement)); Iterator i = buildEventListeners(formElement, "on-processing-phase", ProcessingPhaseListener.class).iterator(); while (i.hasNext()) { formDefinition.addProcessingPhaseListener((ProcessingPhaseListener) i.next()); } setupDefinition(formElement, formDefinition, context); setDisplayData(formElement, formDefinition); setupContainer(formElement, "widgets", formDefinition, context); formDefinition.resolve(); formDefinition.makeImmutable(); return formDefinition; } }
lib.setSourceURI(LocationAttributes.getURI(configElm)); flag = true;