private void generateResourceManagerElement(AttributesImpl atts) throws SAXException { handler.startElement("", RESOURCE_MANAGER, RESOURCE_MANAGER, atts); handler.endElement("", RESOURCE_MANAGER, RESOURCE_MANAGER); }
/** * Generates XML for a <code>String</code> */ private void generate(String s) throws SAXException { handler.startElement("", STRING, STRING, EMPTY); handler.characters(s.toCharArray(), 0, s.length()); handler.endElement("", STRING, STRING); }
/** * Generates XML for a locator */ private void generateLocator(DistributionLocatorConfig config) throws SAXException { AttributesImpl atts = new AttributesImpl(); atts.addAttribute("", "", PORT, "", String.valueOf(config.getPort())); handler.startElement("", LOCATOR, LOCATOR, atts); generateEntityConfig(config); handler.endElement("", LOCATOR, LOCATOR); }
contentHandler.endElement("", "", qName.intern()); contentHandler.endElement(names[0], names[1], names[2]); Enumeration prefixes = nsSupport.getDeclaredPrefixes(); while (prefixes.hasMoreElements()) { String prefix = (String)prefixes.nextElement(); contentHandler.endPrefixMapping(prefix);
inDocHandler.startElement("", "classes", "classes", new AttributesImpl()); inDocHandler.endElement("", "classes", "classes"); inDocHandler.endDocument();
case XmlPullParser.TEXT: final char[] chars = pp.getTextCharacters(holderForStartAndLength); contentHandler.characters(chars, holderForStartAndLength[0], //start holderForStartAndLength[1] //len rawName.append(name); contentHandler.endElement(pp.getNamespace(), name, prefix != null ? name : rawName.toString() contentHandler.endPrefixMapping( pp.getNamespacePrefix(i) ); contentHandler.endElement(pp.getNamespace(), pp.getName(), pp.getName()
/** * Encode an AttributeType whose value type is a Boolean. * * @param attribute * @throws SAXException */ protected void encodeBoolean(AttributeDescriptor attribute) throws SAXException { AttributesImpl atts = createStandardAttributes(attribute); atts.addAttribute("", "type", "type", "", "xs:boolean"); contentHandler.startElement(SCHEMA_NS, "element", "xs:element", atts); contentHandler.endElement(SCHEMA_NS, "element", "xs:element"); }
public void generate() throws IOException, SAXException, ProcessingException { contentHandler.startDocument(); contentHandler.startPrefixMapping(FormsConstants.INSTANCE_PREFIX, FormsConstants.INSTANCE_NS); Attributes formAtts = this.config.getFormAttributes(); contentHandler.startElement(FormsConstants.INSTANCE_NS, FORM_GENERATED_EL, FormsConstants.INSTANCE_PREFIX_COLON +FORM_GENERATED_EL, formAtts); Form form = config.findForm(); form.generateSaxFragment(contentHandler, Locale.US); contentHandler.endElement(FormsConstants.INSTANCE_NS, FORM_GENERATED_EL, FormsConstants.INSTANCE_PREFIX_COLON +FORM_GENERATED_EL); contentHandler.endPrefixMapping(FormsConstants.INSTANCE_PREFIX); contentHandler.endDocument(); } }
private void endParagraph() throws SAXException { closeStyleTags(); if (pDepth == 1) { handler.endElement(XHTML, "p", "p"); } else { handler.characters(SPACE, 0, SPACE.length); } pDepth--; }
/** * Generates the <code>serializer-registration</code> element. * */ private void generateSerializerRegistration() throws SAXException { final SerializerCreation sc = this.creation.getSerializerCreation(); if (sc == null) { return; } handler.startElement("", TOP_SERIALIZER_REGISTRATION, TOP_SERIALIZER_REGISTRATION, EMPTY); for (Class c : sc.getSerializerRegistrations()) { handler.startElement("", SERIALIZER_REGISTRATION, SERIALIZER_REGISTRATION, EMPTY); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(c.getName().toCharArray(), 0, c.getName().length()); handler.endElement("", CLASS_NAME, CLASS_NAME); handler.endElement("", SERIALIZER_REGISTRATION, SERIALIZER_REGISTRATION); } for (Map.Entry<Class, Integer> e : sc.getInstantiatorRegistrations().entrySet()) { Class c = e.getKey(); Integer i = e.getValue(); AttributesImpl atts = new AttributesImpl(); atts.addAttribute("", "", ID, "", i.toString()); handler.startElement("", INSTANTIATOR_REGISTRATION, INSTANTIATOR_REGISTRATION, atts); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(c.getName().toCharArray(), 0, c.getName().length()); handler.endElement("", CLASS_NAME, CLASS_NAME); handler.endElement("", INSTANTIATOR_REGISTRATION, INSTANTIATOR_REGISTRATION); } handler.endElement("", TOP_SERIALIZER_REGISTRATION, TOP_SERIALIZER_REGISTRATION); }
private void generateBackupFile(File file) throws SAXException { handler.startElement("", BACKUP, BACKUP, EMPTY); handler.characters(file.getPath().toCharArray(), 0, file.getPath().length()); handler.endElement("", BACKUP, BACKUP); }
if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName()); ? "" : attrName.substring(index + 1); this.m_contentHandler.endPrefixMapping(prefix);
/** * Generates XML for locators in the distributed system */ private void generateDiscovery() throws SAXException { handler.startElement("", LOCATORS, LOCATORS, EMPTY); generateLocators(); handler.endElement("", LOCATORS, LOCATORS); }
public void outputToXml(ContentHandler contentHandler) throws SAXException { contentHandler.startElement("", "", "RECORD", new AttributesImpl()); XMLUtils.addSaxString(contentHandler, "OPCODE", opCode.toString()); contentHandler.startElement("", "", "DATA", new AttributesImpl()); XMLUtils.addSaxString(contentHandler, "TXID", "" + txid); toXml(contentHandler); contentHandler.endElement("", "", "DATA"); contentHandler.endElement("", "", "RECORD"); }
/** * Generate XML for FixedPartitionAttribute element in PartitionedRegion Attributes */ private void generateFixedPartitionAttributes(String kind, List<FixedPartitionAttributes> allStaticAttrs) throws SAXException { for (FixedPartitionAttributes attr : allStaticAttrs) { AttributesImpl sAtts = new AttributesImpl(); sAtts.addAttribute("", "", PARTITION_NAME, "", attr.getPartitionName()); sAtts.addAttribute("", "", IS_PRIMARY, "", String.valueOf(attr.isPrimary())); sAtts.addAttribute("", "", NUM_BUCKETS, "", String.valueOf(attr.getNumBuckets())); handler.startElement("", kind, kind, sAtts); handler.endElement("", kind, kind); } }
/** * Generates XML for key constraints * * @param element The kind of element to generate (KEY_CONSTRAINT or VALUE_CONSTRAINT). */ private void generate(Class c, String element) throws SAXException { if (c != null) { handler.startElement("", element, element, EMPTY); String className = c.getName(); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", element, element); } }
if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName()); prefix = attrName.substring(colon + 1); this.m_contentHandler.endPrefixMapping(prefix); this.m_contentHandler.endPrefixMapping(prefix); if (prefix==null) prefix=""; this.m_contentHandler.endPrefixMapping(prefix);
/** * Generates XML for a region entry */ private void generate(Region.Entry entry) throws SAXException { if ((entry == null)) { return; } handler.startElement("", ENTRY, ENTRY, EMPTY); handler.startElement("", KEY, KEY, EMPTY); generate(entry.getKey()); handler.endElement("", KEY, KEY); handler.startElement("", VALUE, VALUE, EMPTY); generate(entry.getValue()); handler.endElement("", VALUE, VALUE); handler.endElement("", ENTRY, ENTRY); }
public static void addDeclarable(final ContentHandler handler, Declarable declarable) throws SAXException { AttributesImpl EMPTY = new AttributesImpl(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); Object value = entry.getValue(); AttributesImpl atts = new AttributesImpl(); atts.addAttribute("", "", NAME, "", name); handler.startElement("", PARAMETER, PARAMETER, atts); handler.startElement("", STRING, STRING, EMPTY); handler.characters(sValue.toCharArray(), 0, sValue.length()); handler.endElement("", STRING, STRING); handler.startElement("", DECLARABLE, DECLARABLE, EMPTY); addDeclarable(handler, (Declarable) value); handler.endElement("", DECLARABLE, DECLARABLE); handler.endElement("", PARAMETER, PARAMETER);
private void generate(String kind, Declarable d, Properties p) throws SAXException { if (d == null) { return; } handler.startElement("", kind, kind, EMPTY); String className = d.getClass().getName(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); generate(p, null); handler.endElement("", kind, kind); }