当前位置: 首页>>代码示例>>Java>>正文


Java Attributes类代码示例

本文整理汇总了Java中org.xml.sax.Attributes的典型用法代码示例。如果您正苦于以下问题:Java Attributes类的具体用法?Java Attributes怎么用?Java Attributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Attributes类属于org.xml.sax包,在下文中一共展示了Attributes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processUsesConfiguration

import org.xml.sax.Attributes; //导入依赖的package包/类
/**
 * 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*/));
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:24,代码来源:AndroidManifestParser.java

示例2: begin

import org.xml.sax.Attributes; //导入依赖的package包/类
/**
 * 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);

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:ObjectCreateRule.java

示例3: doStartElement

import org.xml.sax.Attributes; //导入依赖的package包/类
@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);
            }
        }
    }
}
 
开发者ID:tencentyun,项目名称:cos-java-sdk-v5,代码行数:26,代码来源:XmlResponsesSaxParser.java

示例4: startElement

import org.xml.sax.Attributes; //导入依赖的package包/类
@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 + "'.");
	}
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:24,代码来源:TSXParser.java

示例5: enterElement

import org.xml.sax.Attributes; //导入依赖的package包/类
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;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:erSet.java

示例6: enterElement

import org.xml.sax.Attributes; //导入依赖的package包/类
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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:qname.java

示例7: startElement

import org.xml.sax.Attributes; //导入依赖的package包/类
@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;
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:PayloadElementSniffer.java

示例8: startAsynchronousWrites

import org.xml.sax.Attributes; //导入依赖的package包/类
/**
 * 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));
}
 
开发者ID:ampool,项目名称:monarch,代码行数:21,代码来源:CacheXmlParser.java

示例9: startElement

import org.xml.sax.Attributes; //导入依赖的package包/类
@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
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:RSSFeed.java

示例10: setAttributes

import org.xml.sax.Attributes; //导入依赖的package包/类
/**
 * 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;
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:EncodingAlgorithmAttributesImpl.java

示例11: startElement

import org.xml.sax.Attributes; //导入依赖的package包/类
@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);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:27,代码来源:DeviceSchema.java

示例12: tspan

import org.xml.sax.Attributes; //导入依赖的package包/类
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());
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:24,代码来源:SVGParser.java

示例13: startChildProperty

import org.xml.sax.Attributes; //导入依赖的package包/类
/**
 * 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);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:29,代码来源:BeanParser.java

示例14: addStart

import org.xml.sax.Attributes; //导入依赖的package包/类
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());
    }
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:8,代码来源:SAXAdapter.java

示例15: getVersion

import org.xml.sax.Attributes; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:15,代码来源:CompositeButtonParser.java


注:本文中的org.xml.sax.Attributes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。