com.bugvm.apple.coredata.NSPersistentStore Maven / Gradle / Ivy
/*
* Copyright (C) 2013-2015 RoboVM AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.bugvm.apple.coredata;
/**/
import java.io.*;
import java.nio.*;
import java.util.*;
import com.bugvm.objc.*;
import com.bugvm.objc.annotation.*;
import com.bugvm.objc.block.*;
import com.bugvm.rt.*;
import com.bugvm.rt.annotation.*;
import com.bugvm.rt.bro.*;
import com.bugvm.rt.bro.annotation.*;
import com.bugvm.rt.bro.ptr.*;
import com.bugvm.apple.foundation.*;
/* */
/**/
/**
* @since Available in iOS 3.0 and later.
*/
/* */
/**/@Library("CoreData") @NativeClass/* */
/**/public/* */ class /**/NSPersistentStore/* */
extends /**/NSObject/* */
/**//* */ {
/**/public static class NSPersistentStorePtr extends Ptr {}/* */
/**/static { ObjCRuntime.bind(NSPersistentStore.class); }/* */
/**//* */
/**/
public NSPersistentStore() {}
protected NSPersistentStore(SkipInit skipInit) { super(skipInit); }
public NSPersistentStore(NSPersistentStoreCoordinator root, String name, NSURL url, NSPersistentStoreOptions options) { super((SkipInit) null); initObject(init(root, name, url, options)); }
/* */
/**/
@Property(selector = "persistentStoreCoordinator")
public native NSPersistentStoreCoordinator getPersistentStoreCoordinator();
@Property(selector = "configurationName")
public native String getConfigurationName();
@Property(selector = "options")
public native NSPersistentStoreOptions getOptions();
@Property(selector = "URL")
public native NSURL getURL();
@Property(selector = "setURL:")
public native void setURL(NSURL v);
@Property(selector = "identifier")
public native String getIdentifier();
@Property(selector = "setIdentifier:")
public native void setIdentifier(String v);
@Property(selector = "type")
public native String getType();
@Property(selector = "isReadOnly")
public native boolean isReadOnly();
@Property(selector = "setReadOnly:")
public native void setReadOnly(boolean v);
@Property(selector = "metadata")
public native NSPersistentStoreMetadata getMetadata();
@Property(selector = "setMetadata:")
public native void setMetadata(NSPersistentStoreMetadata v);
/* */
/**//* */
/**/
@Method(selector = "initWithPersistentStoreCoordinator:configurationName:URL:options:")
protected native @Pointer long init(NSPersistentStoreCoordinator root, String name, NSURL url, NSPersistentStoreOptions options);
public boolean loadMetadata() throws NSErrorException {
NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
boolean result = loadMetadata(ptr);
if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
return result;
}
@Method(selector = "loadMetadata:")
private native boolean loadMetadata(NSError.NSErrorPtr error);
@Method(selector = "didAddToPersistentStoreCoordinator:")
public native void didAddToPersistentStoreCoordinator(NSPersistentStoreCoordinator coordinator);
@Method(selector = "willRemoveFromPersistentStoreCoordinator:")
public native void willRemoveFromPersistentStoreCoordinator(NSPersistentStoreCoordinator coordinator);
public static NSPersistentStoreMetadata getMetadataForPersistentStore(NSURL url) throws NSErrorException {
NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
NSPersistentStoreMetadata result = getMetadataForPersistentStore(url, ptr);
if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
return result;
}
@Method(selector = "metadataForPersistentStoreWithURL:error:")
private static native NSPersistentStoreMetadata getMetadataForPersistentStore(NSURL url, NSError.NSErrorPtr error);
public static boolean setMetadataForPersistentStore(NSPersistentStoreMetadata metadata, NSURL url) throws NSErrorException {
NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
boolean result = setMetadataForPersistentStore(metadata, url, ptr);
if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
return result;
}
@Method(selector = "setMetadata:forPersistentStoreWithURL:error:")
private static native boolean setMetadataForPersistentStore(NSPersistentStoreMetadata metadata, NSURL url, NSError.NSErrorPtr error);
/**
* @since Available in iOS 3.0 and later.
*/
@Method(selector = "migrationManagerClass")
public static native Class extends NSMigrationManager> getMigrationManagerClass();
/* */
}