类org.xml.sax.helpers.AttributesImpl源码实例Demo

下面列出了怎么用org.xml.sax.helpers.AttributesImpl的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: alfresco-remote-api   文件: PropFindMethod.java
/**
 * Output the supported lock types XML element
 * 
 * @param xml XMLWriter
 */
protected void writeLockTypes(XMLWriter xml)
{
    try
    {
        AttributesImpl nullAttr = getDAVHelper().getNullAttributes();

        xml.startElement(WebDAV.DAV_NS, WebDAV.XML_SUPPORTED_LOCK, WebDAV.XML_NS_SUPPORTED_LOCK, nullAttr);

        // Output exclusive lock
        // Shared locks are not supported, as they cannot be supported by the LockService (relevant to ALF-16449).
        writeLock(xml, WebDAV.XML_NS_EXCLUSIVE);

        xml.endElement(WebDAV.DAV_NS, WebDAV.XML_SUPPORTED_LOCK, WebDAV.XML_NS_SUPPORTED_LOCK);
    }
    catch (Exception ex)
    {
        throw new AlfrescoRuntimeException("XML write error", ex);
    }
}
 
源代码2 项目: uima-uimaj   文件: Filter_impl.java
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
        throws SAXException {
  // write the element's start tag
  AttributesImpl attrs = new AttributesImpl();
  attrs.addAttribute("", "syntax", "syntax", "", getSyntax());

  // start element
  aContentHandler.startElement("", "filter", "filter", attrs);

  // write content
  String expr = getExpression();
  aContentHandler.characters(expr.toCharArray(), 0, expr.length());

  // end element
  aContentHandler.endElement("", "filter", "filter");
}
 
源代码3 项目: alfresco-repository   文件: ViewXMLExporter.java
public void startNode(NodeRef nodeRef)
{
    try
    {
        AttributesImpl attrs = new AttributesImpl(); 

        Path path = nodeService.getPath(nodeRef);
        if (path.size() > 1)
        {
            // a child name does not exist for root
            Path.ChildAssocElement pathElement = (Path.ChildAssocElement)path.last();
            QName childQName = pathElement.getRef().getQName();
            attrs.addAttribute(NamespaceService.REPOSITORY_VIEW_1_0_URI, CHILDNAME_LOCALNAME, CHILDNAME_QNAME.toPrefixString(), null, toPrefixString(childQName));
        }
        
        QName type = nodeService.getType(nodeRef);
        contentHandler.startElement(type.getNamespaceURI(), type.getLocalName(), toPrefixString(type), attrs);
    }
    catch (SAXException e)
    {
        throw new ExporterException("Failed to process start node event - node ref " + nodeRef.toString(), e);
    }
}
 
源代码4 项目: jtransc   文件: SAXAnnotationAdapter.java
private void addValueElement(final String element, final String name,
        final String desc, final String value) {
    AttributesImpl att = new AttributesImpl();
    if (name != null) {
        att.addAttribute("", "name", "name", "", name);
    }
    if (desc != null) {
        att.addAttribute("", "desc", "desc", "", desc);
    }
    if (value != null) {
        att.addAttribute("", "value", "value", "",
                SAXClassAdapter.encode(value));
    }

    sa.addElement(element, att);
}
 
源代码5 项目: hadoop   文件: FSEditLogOp.java
private static void appendXAttrsToXml(ContentHandler contentHandler,
    List<XAttr> xAttrs) throws SAXException {
  for (XAttr xAttr: xAttrs) {
    contentHandler.startElement("", "", "XATTR", new AttributesImpl());
    XMLUtils.addSaxString(contentHandler, "NAMESPACE",
        xAttr.getNameSpace().toString());
    XMLUtils.addSaxString(contentHandler, "NAME", xAttr.getName());
    if (xAttr.getValue() != null) {
      try {
        XMLUtils.addSaxString(contentHandler, "VALUE",
            XAttrCodec.encodeValue(xAttr.getValue(), XAttrCodec.HEX));
      } catch (IOException e) {
        throw new SAXException(e);
      }
    }
    contentHandler.endElement("", "", "XATTR");
  }
}
 
源代码6 项目: gemfirexd-oss   文件: CacheXmlGenerator.java
/**
 * Generates XML for the client-subscription tag
 * @param bridge instance of <code>CacheServer</code>
 * 
 * @since 5.7
 */

private void generateClientHaQueue(CacheServer bridge) throws SAXException {
  AttributesImpl atts = new AttributesImpl();
  ClientSubscriptionConfigImpl csc = (ClientSubscriptionConfigImpl)bridge.getClientSubscriptionConfig();
  try {
      atts.addAttribute("", "", CLIENT_SUBSCRIPTION_EVICTION_POLICY, "", csc.getEvictionPolicy());
      atts.addAttribute("", "", CLIENT_SUBSCRIPTION_CAPACITY, "", String.valueOf(csc.getCapacity()));
      if (this.version.compareTo(VERSION_6_5) >= 0) {
        String dsVal = csc.getDiskStoreName();
        if (dsVal != null) {
          atts.addAttribute("", "", DISK_STORE_NAME, "", dsVal);
        }
      }
      if (csc.getDiskStoreName() == null && csc.hasOverflowDirectory()) {
        atts.addAttribute("", "", OVERFLOW_DIRECTORY, "", csc.getOverflowDirectory());
      }
      handler.startElement("", CLIENT_SUBSCRIPTION, CLIENT_SUBSCRIPTION, atts);
      handler.endElement("", CLIENT_SUBSCRIPTION, CLIENT_SUBSCRIPTION);
    
  } catch (Exception ex) {
    ex.printStackTrace();
  }     
}
 
@Test
public void testStartElement() throws SAXException {
  handler.startDocument();
  Locator2 locator = Mockito.mock(Locator2.class);
  handler.setDocumentLocator(locator);
  Mockito.when(locator.getLineNumber()).thenReturn(1);
  Mockito.when(locator.getColumnNumber()).thenReturn(7);
  handler.startElement("", "", "element", new AttributesImpl());
  
  assertEquals(1, handler.getElementStack().size());
  
  Element element = handler.getElementStack().pop();
  DocumentLocation location = (DocumentLocation) element.getUserData("location");
  assertEquals(1, location.getLineNumber());
  assertEquals(7, location.getColumnNumber());
}
 
源代码8 项目: awacs   文件: SAXClassAdapter.java
@Override
public FieldVisitor visitField(final int access, final String name,
        final String desc, final String signature, final Object value) {
    StringBuilder sb = new StringBuilder();
    appendAccess(access | ACCESS_FIELD, sb);

    AttributesImpl att = new AttributesImpl();
    att.addAttribute("", "access", "access", "", sb.toString());
    att.addAttribute("", "name", "name", "", name);
    att.addAttribute("", "desc", "desc", "", desc);
    if (signature != null) {
        att.addAttribute("", "signature", "signature", "",
                encode(signature));
    }
    if (value != null) {
        att.addAttribute("", "value", "value", "", encode(value.toString()));
    }

    return new SAXFieldAdapter(sa, att);
}
 
private void writePermission(ManifestPermission permission) throws SAXException
{
    AttributesImpl attributes = new AttributesImpl();
    attributes.addAttribute(TransferModel.TRANSFER_MODEL_1_0_URI, "status", "status", "String",
                permission.getStatus());
    attributes.addAttribute(TransferModel.TRANSFER_MODEL_1_0_URI, "authority", "authority", "String",
            permission.getAuthority());
    attributes.addAttribute(TransferModel.TRANSFER_MODEL_1_0_URI, "permission", "permission", "String",
            permission.getPermission());

    writer.startElement(TransferModel.TRANSFER_MODEL_1_0_URI,
            ManifestModel.LOCALNAME_ELEMENT_ACL_PERMISSION, PREFIX + ":"
                        + ManifestModel.LOCALNAME_ELEMENT_ACL_PERMISSION, attributes);

    writer.endElement(TransferModel.TRANSFER_MODEL_1_0_URI,
            ManifestModel.LOCALNAME_ELEMENT_ACL_PERMISSION, PREFIX + ":"
                        + ManifestModel.LOCALNAME_ELEMENT_ACL_PERMISSION);
}
 
@SuppressWarnings("unchecked")
private void writeCategory (NodeRef nodeRef, ManifestCategory value) throws SAXException
{
    
    AttributesImpl attributes = new AttributesImpl();
    attributes.addAttribute(TransferModel.TRANSFER_MODEL_1_0_URI, "path", "path", "String",
                    value.getPath());
    writer.startElement(TransferModel.TRANSFER_MODEL_1_0_URI,
                    ManifestModel.LOCALNAME_ELEMENT_CATEGORY, PREFIX + ":"
                                + ManifestModel.LOCALNAME_ELEMENT_CATEGORY, attributes);
    writeValue(nodeRef);
        
    writer.endElement(TransferModel.TRANSFER_MODEL_1_0_URI,
                ManifestModel.LOCALNAME_ELEMENT_CATEGORY, PREFIX + ":"
                            + ManifestModel.LOCALNAME_ELEMENT_CATEGORY);    
}
 
源代码11 项目: AliceBot   文件: AIMLHandlerTest.java
public void testCategory() throws Exception {
	char[] text;
	AttributesImpl attributes = new AttributesImpl();
	handler.startElement(null, null, "category", attributes);
	handler.startElement(null, null, "pattern", attributes);
	handler.characters(text = toCharArray("HELLO ALICE I AM *"), 0,
			text.length);
	handler.endElement(null, null, "pattern");
	handler.startElement(null, null, "that", attributes);
	handler.characters(text = toCharArray("TEST"), 0, text.length);
	handler.endElement(null, null, "that");
	handler.startElement(null, null, "template", attributes);
	handler.characters(text = toCharArray("Hello "), 0, text.length);
	handler.startElement(null, null, "star", attributes);
	handler.characters(text = toCharArray(", nice to meet you."), 0,
			text.length);
	handler.endElement(null, null, "template");
	handler.endElement(null, null, "category");

	Category actual = (Category) stack.peek();
	Category expected = new Category(new Pattern("HELLO ALICE I AM *"),
			new That("TEST"), new Template("Hello ", new Star(1),
					", nice to meet you."));
	assertEquals(expected, actual);
}
 
源代码12 项目: AliceBot   文件: AIMLHandlerTest.java
public void testFormal() throws Exception {
	char[] text;
	AttributesImpl attributes = new AttributesImpl();
	handler.startElement(null, null, "formal", attributes);
	handler.characters(
			text = toCharArray("change this input case to title case"), 0,
			text.length);
	handler.endElement(null, null, "formal");

	Formal expected = new Formal("change this input case to title case");
	Formal actual = (Formal) stack.peek();
	assertEquals(expected, actual);

	assertEquals("Change This Input Case To Title Case",
			actual.process(null));
}
 
源代码13 项目: jlibs   文件: DTD.java
public void addMissingAttributes(String elemName, AttributesImpl attributes){
    Map<String, DTDAttribute> attList = this.attributes.get(elemName);
    if(attList==null)
        return;
    for(DTDAttribute dtdAttr: attList.values()){
        switch(dtdAttr.valueType){
            case DEFAULT:
            case FIXED:
                if(attributes.getIndex(dtdAttr.name)==-1 && !dtdAttr.isNamespace()){
                    AttributeType type = dtdAttr.type==AttributeType.ENUMERATION ? AttributeType.NMTOKEN : dtdAttr.type;

                    String namespaceURI = "";
                    String localName = dtdAttr.name;
                    String qname = localName;
                    int colon = qname.indexOf(':');
                    if(colon!=-1){
                        localName = qname.substring(colon+1);
                        String prefix = qname.substring(0, colon);
                        if(prefix.length()>0)
                            namespaceURI = reader.getNamespaceURI(prefix);
                    }
                    attributes.addAttribute(namespaceURI, localName, qname, type.name(), dtdAttr.value);
                }
        }
    }
}
 
源代码14 项目: AliceBot   文件: AIMLHandlerTest.java
public void testJavascript() throws Exception {
	char[] text;
	AttributesImpl attributes = new AttributesImpl();
	handler.startElement(null, null, "javascript", attributes);
	handler.characters(text = toCharArray("Anything can go here"), 0,
			text.length);
	handler.endElement(null, null, "javascript");

	Javascript expected = new Javascript("Anything can go here");
	Javascript actual = (Javascript) stack.peek();
	assertEquals(expected, actual);
	assertFalse(expected
			.equals(new Javascript("Anything else can go here")));

	// assertEquals("", actual.process(null));
}
 
源代码15 项目: ontopia   文件: CanonicalXTMWriter.java
private void write(AssociationIF association, int number) {
  AttributesImpl attributes = reifier(association);
  attributes.addAttribute("", "", AT_NUMBER, null, "" + number);
  
  startElement(EL_ASSOCIATION, attributes);
  attributes.clear();
  writeType(association);
  
  Object[] roles = association.getRoles().toArray();
  Arrays.sort(roles, associationRoleComparator);
  for (int ix = 0; ix < roles.length; ix++)
    write((AssociationRoleIF) roles[ix], ix + 1);

  write(association.getScope());
  writeLocators(association.getItemIdentifiers(), EL_ITEMIDENTIFIERS);

  endElement(EL_ASSOCIATION);
}
 
源代码16 项目: AliceBot   文件: AIMLHandlerTest.java
public void testTemplate() throws Exception {
	char[] text;
	AttributesImpl attributes = new AttributesImpl();
	handler.startElement(null, null, "template", attributes);
	handler.characters(text = toCharArray("Hello "), 0, text.length);
	handler.startElement(null, null, "star", attributes);
	handler.characters(text = toCharArray(",\nnice to meet you, too."), 0,
			text.length);
	handler.endElement(null, null, "template");

	Template tag = (Template) stack.peek();
	assertEquals(new Template("Hello ", new Star(1),
			", nice to meet you, too."), tag);
}
 
源代码17 项目: ant-ivy   文件: OBRXMLWriter.java
private static void saxCapabilityProperty(String n, String t, String v, ContentHandler handler)
        throws SAXException {
    AttributesImpl atts = new AttributesImpl();
    addAttr(atts, CapabilityPropertyHandler.NAME, n);
    if (t != null) {
        addAttr(atts, CapabilityPropertyHandler.TYPE, t);
    }
    addAttr(atts, CapabilityPropertyHandler.VALUE, v);
    handler.startElement("", CapabilityPropertyHandler.CAPABILITY_PROPERTY,
        CapabilityPropertyHandler.CAPABILITY_PROPERTY, atts);
    handler.endElement("", CapabilityPropertyHandler.CAPABILITY_PROPERTY,
        CapabilityPropertyHandler.CAPABILITY_PROPERTY);
    handler.characters("\n".toCharArray(), 0, 1);
}
 
源代码18 项目: gemfirexd-oss   文件: CacheXmlGenerator.java
private void generateGatewayReceiver(Cache cache) throws SAXException{
  Set<GatewayReceiver> receiverList = cache.getGatewayReceivers();
  for (GatewayReceiver receiver : receiverList) {
    AttributesImpl atts = new AttributesImpl();
    //start port          
    if (generateDefaults() || receiver.getStartPort() != GatewayReceiver.DEFAULT_START_PORT)
    atts.addAttribute("", "", START_PORT, "", String.valueOf(receiver.getStartPort()));
    //end port
    if (generateDefaults() || receiver.getEndPort() != GatewayReceiver.DEFAULT_END_PORT)
    atts.addAttribute("", "", END_PORT, "", String.valueOf(receiver.getEndPort()));
    //bind-address
    if (generateDefaults() || (receiver.getBindAddress() != null && !receiver.getBindAddress().equals(GatewayReceiver.DEFAULT_BIND_ADDRESS)))
    atts.addAttribute("", "", BIND_ADDRESS, "", receiver.getBindAddress());
    //maximum-time-between-pings  
    if (generateDefaults() || receiver.getMaximumTimeBetweenPings() != GatewayReceiver.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS)
    atts.addAttribute("", "", MAXIMUM_TIME_BETWEEN_PINGS, "", String.valueOf(receiver.getMaximumTimeBetweenPings()));
    //socket-buffer-size          
    if (generateDefaults() || receiver.getSocketBufferSize() != GatewayReceiver.DEFAULT_SOCKET_BUFFER_SIZE)
    atts.addAttribute("", "", SOCKET_BUFFER_SIZE, "", String.valueOf(receiver.getSocketBufferSize()));
    
    handler.startElement("", GATEWAY_RECEIVER, GATEWAY_RECEIVER, atts);
    
    for (GatewayTransportFilter gsf : receiver.getGatewayTransportFilters()) {
      generateGatewayTransportFilter(gsf);
   }
    handler.endElement("", GATEWAY_RECEIVER, GATEWAY_RECEIVER);
  }
}
 
源代码19 项目: j2objc   文件: DefaultHandlerTest.java
public void testStartElement() {
    try {
        h.startElement("uri", "name", "qname", new AttributesImpl());
    } catch (SAXException e) {
        throw new RuntimeException(e);
    }
}
 
源代码20 项目: openjdk-jdk8u-backup   文件: Parser.java
/**
 * Create an instance of the <code>Stylesheet</code> class,
 * and then parse, typecheck and compile the instance.
 * Must be called after <code>parse()</code>.
 */
public Stylesheet makeStylesheet(SyntaxTreeNode element)
    throws CompilerException {
    try {
        Stylesheet stylesheet;

        if (element instanceof Stylesheet) {
            stylesheet = (Stylesheet)element;
        }
        else {
            stylesheet = new Stylesheet();
            stylesheet.setSimplified();
            stylesheet.addElement(element);
            stylesheet.setAttributes((AttributesImpl) element.getAttributes());

            // Map the default NS if not already defined
            if (element.lookupNamespace(EMPTYSTRING) == null) {
                element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING);
            }
        }
        stylesheet.setParser(this);
        return stylesheet;
    }
    catch (ClassCastException e) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element);
        throw new CompilerException(err.toString());
    }
}
 
源代码21 项目: jdk1.8-source-analysis   文件: Parser.java
/**
 * Create an instance of the <code>Stylesheet</code> class,
 * and then parse, typecheck and compile the instance.
 * Must be called after <code>parse()</code>.
 */
public Stylesheet makeStylesheet(SyntaxTreeNode element)
    throws CompilerException {
    try {
        Stylesheet stylesheet;

        if (element instanceof Stylesheet) {
            stylesheet = (Stylesheet)element;
        }
        else {
            stylesheet = new Stylesheet();
            stylesheet.setSimplified();
            stylesheet.addElement(element);
            stylesheet.setAttributes((AttributesImpl) element.getAttributes());

            // Map the default NS if not already defined
            if (element.lookupNamespace(EMPTYSTRING) == null) {
                element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING);
            }
        }
        stylesheet.setParser(this);
        return stylesheet;
    }
    catch (ClassCastException e) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element);
        throw new CompilerException(err.toString());
    }
}
 
源代码22 项目: JByteMod-Beta   文件: SAXCodeAdapter.java
@Override
public final void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, final boolean itf) {
  AttributesImpl attrs = new AttributesImpl();
  attrs.addAttribute("", "owner", "owner", "", owner);
  attrs.addAttribute("", "name", "name", "", name);
  attrs.addAttribute("", "desc", "desc", "", desc);
  attrs.addAttribute("", "itf", "itf", "", itf ? "true" : "false");
  sa.addElement(Printer.OPCODES[opcode], attrs);
}
 
源代码23 项目: openjdk-jdk9   文件: AttrImplTest.java
/**
 * Javadoc says getLocalName returns null if the index if out of range.
 */
@Test
public void testcase09() {
    AttributesImpl attr = new AttributesImpl();
    attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
    attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
            JEEP_VALUE);
    attr.removeAttribute(1);
    assertNull(attr.getLocalName(1));
}
 
源代码24 项目: openjdk-jdk9   文件: AttrImplTest.java
/**
 * Basic test for getLength().
 */
@Test
public void testcase08() {
    AttributesImpl attr = new AttributesImpl();
    assertEquals(attr.getLength(), 0);
    attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
    attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
            JEEP_VALUE);
    assertEquals(attr.getLength(), 2);
}
 
源代码25 项目: mzmine3   文件: PeakListSaveHandler.java
private void fillIsotopePatternElement(IsotopePattern isotopePattern, TransformerHandler hd)
    throws SAXException, IOException {

  AttributesImpl atts = new AttributesImpl();

  DataPoint isotopes[] = isotopePattern.getDataPoints();

  for (DataPoint isotope : isotopes) {
    hd.startElement("", "", PeakListElementName.ISOTOPE.getElementName(), atts);
    String isotopeString = isotope.getMZ() + ":" + isotope.getIntensity();
    hd.characters(isotopeString.toCharArray(), 0, isotopeString.length());
    hd.endElement("", "", PeakListElementName.ISOTOPE.getElementName());
  }
}
 
/**
 * Get the attributes associated with the given START_ELEMENT or ATTRIBUTE
 * StAXevent.
 *
 * @return the StAX attributes converted to an org.xml.sax.Attributes
 */
private Attributes getAttributes() {
    AttributesImpl attrs = new AttributesImpl();

    int eventType = staxStreamReader.getEventType();
    if (eventType != XMLStreamConstants.ATTRIBUTE
        && eventType != XMLStreamConstants.START_ELEMENT) {
        throw new InternalError(
            "getAttributes() attempting to process: " + eventType);
    }

    // in SAX, namespace declarations are not part of attributes by default.
    // (there's a property to control that, but as far as we are concerned
    // we don't use it.) So don't add xmlns:* to attributes.

    // gather non-namespace attrs
    for (int i = 0; i < staxStreamReader.getAttributeCount(); i++) {
        String uri = staxStreamReader.getAttributeNamespace(i);
        if(uri==null)   uri="";
        String localName = staxStreamReader.getAttributeLocalName(i);
        String prefix = staxStreamReader.getAttributePrefix(i);
        String qName;
        if(prefix==null || prefix.length()==0)
            qName = localName;
        else
            qName = prefix + ':' + localName;
        String type = staxStreamReader.getAttributeType(i);
        String value = staxStreamReader.getAttributeValue(i);

        attrs.addAttribute(uri, localName, qName, type, value);
    }

    return attrs;
}
 
源代码27 项目: ganttproject   文件: ResourceSaver.java
private void saveRates(HumanResource p, TransformerHandler handler) throws SAXException {
  if (!BigDecimal.ZERO.equals(p.getStandardPayRate())) {
    AttributesImpl attrs = new AttributesImpl();
    addAttribute("name", "standard", attrs);
    addAttribute("value", p.getStandardPayRate().toPlainString(), attrs);
    emptyElement("rate", attrs, handler);
  }
}
 
源代码28 项目: openjdk-8   文件: StringHeader.java
public void writeTo(ContentHandler h, ErrorHandler errorHandler) throws SAXException {
    String nsUri = name.getNamespaceURI();
    String ln = name.getLocalPart();

    h.startPrefixMapping("",nsUri);
    if(mustUnderstand) {
        AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute(soapVersion.nsUri,MUST_UNDERSTAND,"S:"+MUST_UNDERSTAND,"CDATA", getMustUnderstandLiteral(soapVersion));
        h.startElement(nsUri,ln,ln,attributes);
    } else {
        h.startElement(nsUri,ln,ln,EMPTY_ATTS);
    }
    h.characters(value.toCharArray(),0,value.length());
    h.endElement(nsUri,ln,ln);
}
 
源代码29 项目: big-c   文件: FSEditLogOp.java
public static void permissionStatusToXml(ContentHandler contentHandler,
    PermissionStatus perm) throws SAXException {
  contentHandler.startElement("", "", "PERMISSION_STATUS", new AttributesImpl());
  XMLUtils.addSaxString(contentHandler, "USERNAME", perm.getUserName());
  XMLUtils.addSaxString(contentHandler, "GROUPNAME", perm.getGroupName());
  fsPermissionToXml(contentHandler, perm.getPermission());
  contentHandler.endElement("", "", "PERMISSION_STATUS");
}
 
源代码30 项目: ontopia   文件: OSLSchemaWriter.java
protected Attributes getMinMax(CardinalityConstraintIF constraint) {
  AttributesImpl atts = new AttributesImpl();

  if (constraint.getMinimum() != 0)
    atts.addAttribute("", "", "min", "CDATA",
                      Integer.toString(constraint.getMinimum()));

  if (constraint.getMaximum() != CardinalityConstraintIF.INFINITY)
    atts.addAttribute("", "", "max", "CDATA",
                      Integer.toString(constraint.getMaximum()));
  
  return atts;
}