Back to project page ContentProviderProcessor.
The source code is released under:
Apache License
If you think the Android project ContentProviderProcessor listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.wackernagel.android.contractcontentprovider; //from ww w .j a v a 2 s . com import android.content.UriMatcher; import android.net.Uri; public class DefaultContentProviderProcessor extends AbstractContentProviderProcessor { private final int directoryType = 1; private final int itemType = 2; private final String databaseTable; private final UriMatcher uriMatcher; public DefaultContentProviderProcessor( String authority, String databaseTable ) { this.databaseTable = databaseTable; uriMatcher = new UriMatcher( UriMatcher.NO_MATCH ); uriMatcher.addURI( authority, databaseTable, directoryType ); uriMatcher.addURI( authority, databaseTable + "/#", itemType ); } @Override public String getTable() { return databaseTable; } @Override public boolean isItemType( Uri uri ) { return (uriMatcher.match( uri ) == itemType); } @Override public boolean isDirectoryType( Uri uri ) { return (uriMatcher.match( uri ) == directoryType); } }