Java 类org.xml.sax.Attributes 实例源码

项目:javaide    文件:AndroidManifestParser.java   
/**
 * Processes the supports-screens node.
 * @param attributes the attributes for the supports-screens node.
 */
private void processUsesConfiguration(Attributes attributes) {
    mManifestData.mUsesConfiguration = new UsesConfiguration();

    mManifestData.mUsesConfiguration.mReqFiveWayNav = getAttributeBooleanValue(
            attributes,
            AndroidManifest.ATTRIBUTE_REQ_5WAYNAV, true /*hasNamespace*/);
    mManifestData.mUsesConfiguration.mReqNavigation = Navigation.getEnum(
            getAttributeValue(attributes,
                    AndroidManifest.ATTRIBUTE_REQ_NAVIGATION, true /*hasNamespace*/));
    mManifestData.mUsesConfiguration.mReqHardKeyboard = getAttributeBooleanValue(
            attributes,
            AndroidManifest.ATTRIBUTE_REQ_HARDKEYBOARD, true /*hasNamespace*/);
    mManifestData.mUsesConfiguration.mReqKeyboardType = Keyboard.getEnum(
            getAttributeValue(attributes,
                    AndroidManifest.ATTRIBUTE_REQ_KEYBOARDTYPE, true /*hasNamespace*/));
    mManifestData.mUsesConfiguration.mReqTouchScreen = TouchScreen.getEnum(
            getAttributeValue(attributes,
                    AndroidManifest.ATTRIBUTE_REQ_TOUCHSCREEN, true /*hasNamespace*/));
}
项目:lams    文件:ObjectCreateRule.java   
/**
 * Process the beginning of this element.
 *
 * @param attributes The attribute list of this element
 */
public void begin(Attributes attributes) throws Exception {

    // Identify the name of the class to instantiate
    String realClassName = className;
    if (attributeName != null) {
        String value = attributes.getValue(attributeName);
        if (value != null) {
            realClassName = value;
        }
    }
    if (digester.log.isDebugEnabled()) {
        digester.log.debug("[ObjectCreateRule]{" + digester.match +
                "}New " + realClassName);
    }

    // Instantiate the new object and push it on the context stack
    Class clazz = digester.getClassLoader().loadClass(realClassName);
    Object instance = clazz.newInstance();
    digester.push(instance);

}
项目:cos-java-sdk-v5    文件:XmlResponsesSaxParser.java   
@Override
protected void doStartElement(String uri, String name, String qName, Attributes attrs) {

    if (in("AccessControlPolicy")) {
        if (name.equals("Owner")) {
            accessControlList.setOwner(new Owner());

        }
    }

    else if (in("AccessControlPolicy", "AccessControlList", "Grant")) {
        if (name.equals("Grantee")) {
            String type = XmlResponsesSaxParser.findAttributeValue("xsi:type", attrs);

            if ("Group".equals(type)) {
                /*
                 * Nothing to do for GroupGrantees here since we
                 * can't construct an empty enum value early.
                 */
            } else if ("CanonicalUser".equals(type)) {
                currentGrantee = new UinGrantee(null);
            }
        }
    }
}
项目:Phoenicia    文件:TSXParser.java   
@Override
public void startElement(final String pUri, final String pLocalName, final String pQualifiedName, final Attributes pAttributes) throws SAXException {
    if(pLocalName.equals(TMXConstants.TAG_TILESET)){
        this.mInTileset = true;
        this.mTMXTileSet = new TMXTileSet(this.mFirstGlobalTileID, pAttributes, this.mTextureOptions, this.mTMXTileSetSourceManager);
    } else if (pLocalName.equals(TMXConstants.TAG_OFFSET)){
        this.mInTileOffset = true;
        this.mTMXTileSet.addTileOffset(pAttributes);
    } else if(pLocalName.equals(TMXConstants.TAG_IMAGE)){
        this.mInImage = true;
        this.mTMXTileSet.setImageSource(this.mAssetManager, this.mTextureManager, pAttributes);
    } else if(pLocalName.equals(TMXConstants.TAG_TILE)) {
        this.mInTile = true;
        this.mLastTileSetTileID = SAXUtils.getIntAttributeOrThrow(pAttributes, TMXConstants.TAG_TILE_ATTRIBUTE_ID);
    } else if(pLocalName.equals(TMXConstants.TAG_PROPERTIES)) {
        this.mInProperties = true;
    } else if(pLocalName.equals(TMXConstants.TAG_PROPERTY)) {
        this.mInProperty = true;
        this.mTMXTileSet.addTMXTileProperty(this.mLastTileSetTileID, new TMXTileProperty(pAttributes));
    } else {
        throw new TMXParseException("Unexpected start tag: '" + pLocalName + "'.");
    }
}
项目:openjdk-jdk10    文件:erSet.java   
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
    int $ai;
    $uri = $__uri;
    $localName = $__local;
    $qname = $__qname;
    switch($_ngcc_current_state) {
    case 0:
        {
            revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
        }
        break;
    default:
        {
            unexpectedEnterElement($__qname);
        }
        break;
    }
}
项目:OpenJSharp    文件:qname.java   
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
    int $ai;
    $uri = $__uri;
    $localName = $__local;
    $qname = $__qname;
    switch($_ngcc_current_state) {
    case 0:
        {
            revertToParentFromEnterElement($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname, $attrs);
        }
        break;
    default:
        {
            unexpectedEnterElement($__qname);
        }
        break;
    }
}
项目:OpenJSharp    文件:PayloadElementSniffer.java   
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {

    if (bodyStarted) {
        payloadQName = new QName(uri, localName);
        // we have what we wanted - let's skip rest of parsing ...
        throw new SAXException("Payload element found, interrupting the parsing process.");
    }

    // check for both SOAP 1.1/1.2
    if (equalsQName(uri, localName, SOAPConstants.QNAME_SOAP_BODY) ||
            equalsQName(uri, localName, SOAP12Constants.QNAME_SOAP_BODY)) {
        bodyStarted = true;
    }

}
项目:monarch    文件:CacheXmlParser.java   
/**
 * When a <code>asynchronous-writes</code> element is encounter, we push a
 * {@link DiskWriteAttributes} for doing asynchronous writes on the stack.
 */
private void startAsynchronousWrites(Attributes atts) {
  int maxOplogSize = ((Integer) stack.pop()).intValue();
  String rollOplog = (String) stack.pop();
  // convery megabytes to bytes for DiskWriteAttributes creation
  long maxOplogSizeInBytes = maxOplogSize;
  maxOplogSizeInBytes = maxOplogSizeInBytes * 1024 * 1024;
  long timeInterval = parseLong(atts.getValue(TIME_INTERVAL));
  long bytesThreshold = parseLong(atts.getValue(BYTES_THRESHOLD));
  Properties props = new Properties();
  props.setProperty(MAX_OPLOG_SIZE, String.valueOf(maxOplogSizeInBytes));
  props.setProperty(ROLL_OPLOG, rollOplog);
  props.setProperty(TIME_INTERVAL, String.valueOf(timeInterval));
  props.setProperty(DiskWriteAttributesImpl.SYNCHRONOUS_PROPERTY, "false");
  props.setProperty(BYTES_THRESHOLD, String.valueOf(bytesThreshold));
  stack.push(new DiskWriteAttributesImpl(props));
}
项目:incubator-netbeans    文件:RSSFeed.java   
@Override
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
    if( itemList.size() < maxItemCount ) {
        if( "item".equals( localName )
                || "entry".equals( localName ) ) { // NOI18N
            currentItem = new FeedItem();
        } else if( "link".equals( localName ) // NOI18N
                || "pubDate".equals( localName ) // NOI18N
                || "date".equals( localName ) // NOI18N
                || "published".equals( localName ) // NOI18N
                || "description".equals( localName ) // NOI18N
                || "content".equals( localName ) // NOI18N
                || "title".equals( localName ) ) { // NOI18N
            textBuffer = new StringBuffer( 110 );

            if( "link".equals(localName) && null != currentItem && null != atts.getValue("href") )
                currentItem.link = fixFeedItemUrl(atts.getValue("href"));
        } else if( "enclosure".equals( localName ) && null != currentItem ) { //NOI18N
            currentItem.enclosureUrl = atts.getValue( "url" ); //NOI18N
        }
    }
}
项目:openjdk-jdk10    文件:EncodingAlgorithmAttributesImpl.java   
/**
 * Copy an entire Attributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(Attributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            index++;
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
项目:javaide    文件:DeviceSchema.java   
@Override
public void startElement(String uri, String localName, String name, Attributes attributes)
        throws SAXException {
    if (NODE_DEVICE.equals(localName)) {
        // Reset for a new device
        mDefaultSeen = false;
    } else if (NODE_STATE.equals(localName)) {
        // Check if the state is set to be a default state
        String val = attributes.getValue(ATTR_DEFAULT);
        if (val != null && ("1".equals(val) || Boolean.parseBoolean(val))) {
            /*
             * If it is and we already have a default state for this
             * device, then the device configuration is invalid.
             * Otherwise, set that we've seen a default state for this
             * device and continue
             */

            if (mDefaultSeen) {
                validationError("More than one default state for device " + mDeviceName);
            } else {
                mDefaultSeen = true;
            }
        }
    }
    mStringAccumulator.setLength(0);
}
项目:microMathematics    文件:SVGParser.java   
private void tspan(Attributes attributes) throws SAXException {
    debug("<tspan>");

    if (currentElement == null)
        throw new SAXException(
                "Invalid document. Root element must be <svg>");
    if (!(currentElement instanceof SVG.TextContainer))
        throw new SAXException(
                "Invalid document. <tspan> elements are only valid inside <text> or other <tspan> elements.");
    SVG.TSpan obj = new SVG.TSpan();
    obj.document = svgDocument;
    obj.parent = currentElement;
    parseAttributesCore(obj, attributes);
    parseAttributesStyle(obj, attributes);
    parseAttributesConditional(obj, attributes);
    parseAttributesTextPosition(obj, attributes);
    currentElement.addChild(obj);
    currentElement = obj;
    if (obj.parent instanceof TextRoot)
        obj.setTextRoot((TextRoot) obj.parent);
    else
        obj.setTextRoot(((TextChild) obj.parent).getTextRoot());
}
项目:myfaces-trinidad    文件:BeanParser.java   
/**
 * Called when an XML element is being parsed as a bean property.
 * @see #startInlineChildProperty
 * @see #startEnvelopeChildProperty
 * @param context the parsing context
 * @param namespaceURI the namespace of the element
 * @param localName the local name of the element
 * @param attrs the attributes attached to the element
 * @param def the property definition
 */
final protected NodeParser startChildProperty(
  ParseContext context,
  String       namespaceURI,
  String       localName,
  Attributes   attrs,
  PropertyDef def)
{
  if (isInlineChildProperty(context, namespaceURI, localName, def))
  {
    return startInlineChildProperty(context, namespaceURI, localName,
                                     attrs, def);
  }
  else
  {
    return startEnvelopeChildProperty(context, namespaceURI, localName,
                                       attrs, def);
  }
}
项目:DirectLeaks-AntiReleak-Remover    文件:SAXAdapter.java   
protected final void addStart(final String name, final Attributes attrs) {
    try {
        h.startElement("", name, name, attrs);
    } catch (SAXException ex) {
        throw new RuntimeException(ex.getMessage(), ex.getException());
    }
}
项目:myfaces-trinidad    文件:CompositeButtonParser.java   
/**
 * Gets the String value of the "version" attribute.
 * <p>
 * Returns null if the version attribute is not specified.  
 * Otherwise, returns a String indicating the value of the 
 * version attribute.
 */
protected String getVersion(
  ParseContext context,
  Attributes   attrs
  )
{
  return attrs.getValue(XMLConstants.VERSION_ATTR);
}
项目:Reer    文件:IvyXmlModuleDescriptorParser.java   
public void startElement(String uri, String localName, String qName, Attributes attributes)
        throws SAXException {
    try {
        if (state == State.DESCRIPTION) {
            // make sure we don't interpret any tag while in description tag
            descriptionStarted(qName, attributes);
        } else if ("ivy-module".equals(qName)) {
            ivyModuleStarted(attributes);
        } else if ("info".equals(qName)) {
            infoStarted(attributes);
        } else if (state == State.INFO && "extends".equals(qName)) {
            extendsStarted(attributes);
        } else if (state == State.INFO && "license".equals(qName)) {
            getMd().addLicense(new License(substitute(attributes.getValue("name")), substitute(attributes.getValue("url"))));
        } else if (state == State.INFO && "ivyauthor".equals(qName)) {
            // nothing to do, we don't store this
            return;
        } else if (state == State.INFO && "repository".equals(qName)) {
            // nothing to do, we don't store this
            return;
        } else if (state == State.INFO && "description".equals(qName)) {
            getMd().setHomePage(substitute(attributes.getValue("homepage")));
            state = State.DESCRIPTION;
            buffer = new StringBuffer();
        } else if (state == State.INFO && isOtherNamespace(qName)) {
            buffer = new StringBuffer();
            state = State.EXTRA_INFO;
        } else if ("configurations".equals(qName)) {
            configurationStarted(attributes);
        } else if ("publications".equals(qName)) {
            publicationsStarted(attributes);
        } else if ("dependencies".equals(qName)) {
            dependenciesStarted(attributes);
        } else if ("conflicts".equals(qName)) {
            state = State.CONFLICT;
            maybeAddDefaultConfiguration();
        } else if ("artifact".equals(qName)) {
            artifactStarted(qName, attributes);
        } else if ("include".equals(qName) && state == State.DEP) {
            addIncludeRule(qName, attributes);
        } else if ("exclude".equals(qName) && state == State.DEP) {
            addExcludeRule(qName, attributes);
        } else if ("exclude".equals(qName) && state == State.DEPS) {
            state = State.EXCLUDE;
            parseRule(qName, attributes);
            getMd().addExcludeRule((ExcludeRule) confAware);
        } else if ("dependency".equals(qName)) {
            dependencyStarted(attributes);
        } else if ("conf".equals(qName)) {
            confStarted(attributes);
        } else if ("mapped".equals(qName)) {
            dd.addDependencyConfiguration(conf, substitute(attributes.getValue("name")));
        } else if (("conflict".equals(qName) && state == State.DEPS) || "manager".equals(qName) && state == State.CONFLICT) {
            LOGGER.debug("Ivy.xml conflict managers are not supported by Gradle. Ignoring conflict manager declared in {}", getResource().getDisplayName());
        } else if ("override".equals(qName) && state == State.DEPS) {
            LOGGER.debug("Ivy.xml dependency overrides are not supported by Gradle. Ignoring override declared in {}", getResource().getDisplayName());
        } else if ("include".equals(qName) && state == State.CONF) {
            includeConfStarted(attributes);
        } else if (validate && state != State.EXTRA_INFO && state != State.DESCRIPTION) {
            addError("unknown tag " + qName);
        }
    } catch (Exception ex) {
        if (ex instanceof SAXException) {
            throw (SAXException) ex;
        }
        SAXException sax = new SAXException("Problem occurred while parsing ivy file: "
                + ex.getMessage(), ex);
        sax.initCause(ex);
        throw sax;
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:WebRuleSet.java   
@Override
public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
    ContextEnvironment envEntry = (ContextEnvironment) digester.peek();
    envEntry.setOverride(false);
    if (digester.getLogger().isDebugEnabled()) {
        digester.getLogger().debug(
                envEntry.getClass().getName() + ".setOverride(false)");
    }
}
项目:lazycat    文件:NodeCreateRule.java   
/**
 * Adds a new child {@link org.w3c.dom.Element Element} to the current
 * node.
 * 
 * @param namespaceURI
 *            the namespace URI
 * @param localName
 *            the local name
 * @param qName
 *            the qualified (prefixed) name
 * @param atts
 *            the list of attributes
 * @throws SAXException
 *             if the DOM implementation throws an exception
 */
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
        throws SAXException {

    try {
        Node previousTop = top;
        if ((localName == null) || (localName.length() == 0)) {
            top = doc.createElement(qName);
        } else {
            top = doc.createElementNS(namespaceURI, localName);
        }
        for (int i = 0; i < atts.getLength(); i++) {
            Attr attr = null;
            if ((atts.getLocalName(i) == null) || (atts.getLocalName(i).length() == 0)) {
                attr = doc.createAttribute(atts.getQName(i));
                attr.setNodeValue(atts.getValue(i));
                ((Element) top).setAttributeNode(attr);
            } else {
                attr = doc.createAttributeNS(atts.getURI(i), atts.getLocalName(i));
                attr.setNodeValue(atts.getValue(i));
                ((Element) top).setAttributeNodeNS(attr);
            }
        }
        previousTop.appendChild(top);
        depth++;
    } catch (DOMException e) {
        throw new SAXException(e.getMessage(), e);
    }

}
项目:Reer    文件:IvyXmlModuleDescriptorParser.java   
private void artifactStarted(String qName, Attributes attributes)
        throws MalformedURLException {
    if (state == State.PUB) {
        // this is a published artifact
        String artName = elvis(substitute(attributes.getValue("name")), getMd().getModuleRevisionId().getName());
        String type = elvis(substitute(attributes.getValue("type")), "jar");
        String ext = elvis(substitute(attributes.getValue("ext")), type);
        String classifier = attributes.getValue(IvyModulePublishMetadata.IVY_MAVEN_NAMESPACE, "classifier");
        artifact = new BuildableIvyArtifact(artName, type, ext, classifier);
        String confs = substitute(attributes.getValue("conf"));

        // Only add confs if they are specified. if they aren't, endElement will handle this only if there are no conf defined in sub elements
        if (confs != null && confs.length() > 0) {
            String[] conf;
            if ("*".equals(confs)) {
                conf = getMd().getConfigurationsNames();
            } else {
                conf = confs.split(",");
            }
            for (String confName : conf) {
                artifact.addConfiguration(confName.trim());
            }
        }
    } else if (state == State.DEP) {
        // this is an artifact asked for a particular dependency
        addDependencyArtifacts(qName, attributes);
    } else if (validate) {
        addError("artifact tag found in invalid tag: " + state);
    }
}
项目:openjdk-jdk10    文件:SynthParser.java   
private void startOpaque(Attributes attributes) {
    if (_style != null) {
        _style.setOpaque(true);
        for(int i = attributes.getLength() - 1; i >= 0; i--) {
            String key = attributes.getQName(i);

            if (key.equals(ATTRIBUTE_VALUE)) {
                _style.setOpaque("true".equals(attributes.getValue(i).
                                               toLowerCase()));
            }
        }
    }
}
项目:microMathematics    文件:SVGParser.java   
private void parseAttributesStop(SVG.Stop obj, Attributes attributes)
        throws SAXException {
    for (int i = 0; i < attributes.getLength(); i++) {
        String val = attributes.getValue(i).trim();
        switch (SVGAttr.fromString(attributes.getLocalName(i))) {
        case offset:
            obj.offset = parseGradientOffset(val);
            break;
        default:
            break;
        }
    }
}
项目:DirectLeaks-AntiReleak-Remover    文件:ASMContentHandler.java   
@Override
public final void begin(final String name, final Attributes attrs) {
    int major = Integer.parseInt(attrs.getValue("major"));
    int minor = Integer.parseInt(attrs.getValue("minor"));
    HashMap<String, Object> vals = new HashMap<String, Object>();
    vals.put("version", minor << 16 | major);
    vals.put("access", attrs.getValue("access"));
    vals.put("name", attrs.getValue("name"));
    vals.put("parent", attrs.getValue("parent"));
    vals.put("source", attrs.getValue("source"));
    vals.put("signature", attrs.getValue("signature"));
    vals.put("interfaces", new ArrayList<String>());
    push(vals);
    // values will be extracted in InterfacesRule.end();
}
项目:lazycat    文件:WebRuleSet.java   
@Override
public void begin(String namespace, String name, Attributes attributes) throws Exception {
    if (isNameSet) {
        throw new IllegalArgumentException(WebRuleSet.sm.getString("webRuleSet.nameCount"));
    }
    isNameSet = true;
}
项目:hadoop    文件:HftpFileSystem.java   
@Override
public void startElement(String ns, String localname, String qname,
            Attributes attrs) throws SAXException {
  if (!MD5MD5CRC32FileChecksum.class.getName().equals(qname)) {
    if (RemoteException.class.getSimpleName().equals(qname)) {
      throw new SAXException(RemoteException.valueOf(attrs));
    }
    throw new SAXException("Unrecognized entry: " + qname);
  }

  filechecksum = MD5MD5CRC32FileChecksum.valueOf(attrs);
}
项目:myfaces-trinidad    文件:SkinsNodeParser.java   
@Override
public NodeParser startChildElement(
  ParseContext context,
  String       namespaceURI,
  String       localName,
  Attributes   attrs
  ) throws SAXParseException
{
  if ("skin-addition".equals(localName))
    return context.getParser(SkinAddition.class, namespaceURI, localName);
  else
    return context.getParser(SkinMetadata.class, namespaceURI, localName);
}
项目:otus_java_2017_10    文件:ObjectBuilderSaxHandler.java   
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
    if(!qName.equals(CLASS_ATTRIBUTE_NAME)){
        element = qName;
    }
    else{
        String className = attributes.getValue(0);
        System.out.println("Class name: " + className);
        object = ReflectionHelper.createInstance(className);
    }   
}
项目:lams    文件:Parser.java   
/**
 * Attributes ::= (S Attribute)* S?
 */
Attributes parseAttributes() throws JasperException {
    AttributesImpl attrs = new AttributesImpl();

    reader.skipSpaces();
    while (parseAttribute(attrs))
        reader.skipSpaces();

    return attrs;
}
项目:tomcat7    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:morf    文件:XmlDataSetConsumer.java   
/**
 * Build the attributes for a database index
 *
 * @param index The index
 * @return The attributes
 */
private Attributes buildIndexAttributes(Index index) {
  AttributesImpl indexAttributes = new AttributesImpl();

  indexAttributes.addAttribute(XmlDataSetNode.URI, XmlDataSetNode.NAME_ATTRIBUTE, XmlDataSetNode.NAME_ATTRIBUTE,
    XmlDataSetNode.STRING_TYPE, index.getName());
  indexAttributes.addAttribute(XmlDataSetNode.URI, XmlDataSetNode.UNIQUE_ATTRIBUTE, XmlDataSetNode.UNIQUE_ATTRIBUTE,
    XmlDataSetNode.STRING_TYPE, Boolean.toString(index.isUnique()));

  String columnNames = StringUtils.join(index.columnNames(), ",");
  indexAttributes.addAttribute(XmlDataSetNode.URI, XmlDataSetNode.COLUMNS_ATTRIBUTE, XmlDataSetNode.COLUMNS_ATTRIBUTE,
    XmlDataSetNode.STRING_TYPE, columnNames);

  return indexAttributes;
}
项目:apache-tomcat-7.0.73-with-comment    文件:WebRuleSet.java   
@Override
public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
    if (!fragment) {
        digester.getLogger().warn(
                WebRuleSet.sm.getString("webRuleSet.relativeOrdering"));
    }
    if (isRelativeOrderingSet) {
        throw new IllegalArgumentException(WebRuleSet.sm.getString(
                "webRuleSet.relativeOrderingCount"));
    } else {
        isRelativeOrderingSet = true;
    }
}
项目:GitHub    文件:RssHandler.java   
@Override
public void startElement(String uri, String localName,
                         String name, Attributes attributes) throws SAXException {
    super.startElement(uri, localName, name, attributes);

    if (localName.equals("update")) {
        update = new Update();
    }
}
项目:tomcat7    文件:Parser.java   
private void parseGetProperty(Node parent) throws JasperException {
    Attributes attrs = parseAttributes();
    reader.skipSpaces();

    Node getPropertyNode = new Node.GetProperty(attrs, start, parent);

    parseOptionalBody(getPropertyNode, "jsp:getProperty",
            TagInfo.BODY_CONTENT_EMPTY);
}
项目:lams    文件:Node.java   
public TagDirective(String qName, Attributes attrs,
        Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs,
        Mark start, Node parent) {
    super(qName, TAG_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
            taglibAttrs, start, parent);
    imports = new Vector();
}
项目:ibm-cos-sdk-java    文件:XmlResponsesSaxParser.java   
@Override
protected void doStartElement(
        String uri,
        String name,
        String qName,
        Attributes attrs) {

    if (in("ListBucketAnalyticsConfigurationsResult")) {
        if (name.equals("AnalyticsConfiguration")) {
            currentConfiguration = new AnalyticsConfiguration();
        }

    } else if (in("ListBucketAnalyticsConfigurationsResult", "AnalyticsConfiguration")) {
        if (name.equals("Filter")) {
            currentFilter = new AnalyticsFilter();
        } else if (name.equals("StorageClassAnalysis")) {
            storageClassAnalysis = new StorageClassAnalysis();
        }

    } else if (in("ListBucketAnalyticsConfigurationsResult", "AnalyticsConfiguration", "Filter")) {
        if (name.equals("And")) {
            andOperandsList = new ArrayList<AnalyticsFilterPredicate>();
        }

    } else if (in("ListBucketAnalyticsConfigurationsResult", "AnalyticsConfiguration", "StorageClassAnalysis")) {
        if (name.equals("DataExport")) {
            dataExport = new StorageClassAnalysisDataExport();
        }

    } else if (in("ListBucketAnalyticsConfigurationsResult", "AnalyticsConfiguration", "StorageClassAnalysis", "DataExport")) {
        if (name.equals("Destination")) {
            destination = new AnalyticsExportDestination();
        }

    } else if (in("ListBucketAnalyticsConfigurationsResult", "AnalyticsConfiguration", "StorageClassAnalysis", "DataExport", "Destination")) {
        if (name.equals("S3BucketDestination")) {
            s3BucketDestination = new AnalyticsS3BucketDestination();
        }
    }
}
项目:lams    文件:Parser.java   
private void parseIncludeDirective(Node parent) throws JasperException {
    Attributes attrs = parseAttributes();

    // Included file expanded here
    Node includeNode = new Node.IncludeDirective(attrs, start, parent);
    processIncludeDirective(attrs.getValue("file"), includeNode);
}
项目:jerrydog    文件:WebRuleSet.java   
public void begin(Attributes attributes) throws Exception {
    SecurityConstraint securityConstraint =
        (SecurityConstraint) digester.peek();
    securityConstraint.setAuthConstraint(true);
    if (digester.getDebug() > 0)
        digester.log("Calling SecurityConstraint.setAuthConstraint(true)");
}
项目:OpenJSharp    文件:VocabularyGenerator.java   
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    addToNameTable(namespaceURI, qName, localName,
            _v.elements, _serializerVocabulary.elementName, _parserVocabulary.elementName, false);

    for (int a = 0; a < atts.getLength(); a++) {
        addToNameTable(atts.getURI(a), atts.getQName(a), atts.getLocalName(a),
                _v.attributes, _serializerVocabulary.attributeName, _parserVocabulary.attributeName, true);

        String value = atts.getValue(a);
        if (value.length() < attributeValueSizeConstraint) {
            addToTable(value, _v.attributeValues, _serializerVocabulary.attributeValue, _parserVocabulary.attributeValue);
        }
    }
}
项目:fastAOP    文件:ASMContentHandler.java   
@Override
public final void begin(final String element, final Attributes attrs) {
    String name = attrs.getValue("name");
    String desc = attrs.getValue("desc");
    String signature = attrs.getValue("signature");
    Label start = getLabel(attrs.getValue("start"));
    Label end = getLabel(attrs.getValue("end"));
    int var = Integer.parseInt(attrs.getValue("var"));
    getCodeVisitor().visitLocalVariable(name, desc, signature, start,
            end, var);
}
项目:microMathematics    文件:SVGParser.java   
private void parseAttributesImage(SVG.Image obj, Attributes attributes)
        throws SAXException {
    for (int i = 0; i < attributes.getLength(); i++) {
        String val = attributes.getValue(i).trim();
        switch (SVGAttr.fromString(attributes.getLocalName(i))) {
        case x:
            obj.x = parseLength(val);
            break;
        case y:
            obj.y = parseLength(val);
            break;
        case width:
            obj.width = parseLength(val);
            if (obj.width.isNegative())
                throw new SAXException(
                        "Invalid <use> element. width cannot be negative");
            break;
        case height:
            obj.height = parseLength(val);
            if (obj.height.isNegative())
                throw new SAXException(
                        "Invalid <use> element. height cannot be negative");
            break;
        case href:
            if (!XLINK_NAMESPACE.equals(attributes.getURI(i)))
                break;
            obj.href = val;
            break;
        case preserveAspectRatio:
            parsePreserveAspectRatio(obj, val);
            break;
        default:
            break;
        }
    }
}
项目:OpenJSharp    文件:Schema.java   
private void action15()throws SAXException {
        Attributes test = $runtime.getCurrentAttributes();
        String tns = test.getValue("targetNamespace");

      if(!includeMode) {
        // importing
        if(tns==null) tns=""; // if not present, then the empty namespace
        $runtime.currentSchema = $runtime.parser.schemaSet.createSchema(tns,$runtime.copyLocator());
        if(expectedNamespace!=null && !expectedNamespace.equals(tns)) {
          $runtime.reportError(
            Messages.format("UnexpectedTargetnamespace.Import", tns, expectedNamespace, tns ),
            $runtime.getLocator());
        }
      } else {
        // including

        // check the consistency of @targetNamespace.
        // @targetNamespace must be null or equal to the target namespace of the schema
        if(tns!=null && expectedNamespace!=null && !expectedNamespace.equals(tns)) {
          $runtime.reportError(
            Messages.format("UnexpectedTargetnamespace.Include", tns, expectedNamespace, tns ) );
        }
        $runtime.chameleonMode = true;
      }

      // multiple inclusion test.
      if( $runtime.hasAlreadyBeenRead() ) {
          // skip this document
          $runtime.redirectSubtree(new DefaultHandler(),"","","" );
          return;
      }

      anno = (AnnotationImpl)$runtime.currentSchema.getAnnotation();
      $runtime.blockDefault = 0;
      $runtime.finalDefault = 0;
}