當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。