/** * Return whether we're running the parser at runtime. */ protected boolean isRuntime() { return (getRepository().getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; }
/** * Return whether we're running the parser at runtime. */ protected boolean isRuntime() { return (getRepository().getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; }
/** * Set the metadata repository for this parser. */ public void setRepository(MetaDataRepository repos) { _repos = repos; if (repos != null && (repos.getValidate() & repos.VALIDATE_RUNTIME) != 0) setParseComments(false); }
/** * Return whether we're running the parser at runtime. */ protected boolean isRuntime() { return (getRepository().getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; }
/** * Return whether we're running the parser at runtime. */ protected boolean isRuntime() { return (getRepository().getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; }
/** * Return whether we're running the parser at runtime. */ protected boolean isRuntime() { return (getRepository().getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; }
/** * Set the metadata repository for this parser. */ public void setRepository(MetaDataRepository repos) { _repos = repos; if (repos != null && (repos.getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0) setParseComments(false); if (repos != null) { // Determine if the Thread Context Classloader needs to be temporally overridden to the Classloader // that loaded the OpenJPA classes, to avoid a potential deadlock issue with the way Xerces // handles parsers and classloaders. this.setOverrideContextClassloader(repos.getConfiguration().getCompatibilityInstance(). getOverrideContextClassloader()); } }
/** * Set the metadata repository for this parser. */ public void setRepository(MetaDataRepository repos) { _repos = repos; if (repos != null && (repos.getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0) setParseComments(false); if (repos != null) { // Determine if the Thread Context Classloader needs to be temporally overridden to the Classloader // that loaded the OpenJPA classes, to avoid a potential deadlock issue with the way Xerces // handles parsers and classloaders. this.setOverrideContextClassloader(repos.getConfiguration().getCompatibilityInstance(). getOverrideContextClassloader()); } }
/** * Set the metadata repository for this parser. */ public void setRepository(MetaDataRepository repos) { _repos = repos; if (repos != null && (repos.getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0) setParseComments(false); if (repos != null) { // Determine if the Thread Context Classloader needs to be temporally overridden to the Classloader // that loaded the OpenJPA classes, to avoid a potential deadlock issue with the way Xerces // handles parsers and classloaders. this.setOverrideContextClassloader(repos.getConfiguration().getCompatibilityInstance(). getOverrideContextClassloader()); } }
/** * Set the metadata repository for this parser. */ public void setRepository(MetaDataRepository repos) { _repos = repos; if (repos != null && (repos.getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0) setParseComments(false); if (repos != null) { // Determine if the Thread Context Classloader needs to be temporally overridden to the Classloader // that loaded the OpenJPA classes, to avoid a potential deadlock issue with the way Xerces // handles parsers and classloaders. this.setOverrideContextClassloader(repos.getConfiguration().getCompatibilityInstance(). getOverrideContextClassloader()); } }
/** * Check the given name against the same set of standard packages used * when parsing metadata. */ private static Class classForName(String name, ClassMetaData meta, Class dec, ValueMetaData vmd, ClassLoader loader) { // special case for PersistenceCapable and Object if ("PersistenceCapable".equals(name) || "javax.jdo.PersistenceCapable".equals(name)) // backwards compat return PersistenceCapable.class; if ("Object".equals(name)) return Object.class; MetaDataRepository rep = meta.getRepository(); boolean runtime = (rep.getValidate() & rep.VALIDATE_RUNTIME) != 0; if (loader == null) loader = rep.getConfiguration().getClassResolverInstance(). getClassLoader(dec, meta.getEnvClassLoader()); // try the owner's package String pkg = Strings.getPackageName(dec); Class cls = CFMetaDataParser.classForName(name, pkg, runtime, loader); if (cls == null && vmd != null) { // try against this value type's package too pkg = Strings.getPackageName(vmd.getDeclaredType()); cls = CFMetaDataParser.classForName(name, pkg, runtime, loader); } if (cls == null) throw new MetaDataException(_loc.get("bad-class", name, (vmd == null) ? (Object) meta : (Object) vmd)); return cls; }
/** * Resolve and validate metadata. Return true if already resolved. */ public boolean resolve(int mode) { if ((_resMode & mode) == mode) return true; int cur = _resMode; _resMode |= mode; int val = _repos.getValidate(); boolean runtime = (val & MetaDataRepository.VALIDATE_RUNTIME) != 0; boolean validate = !ImplHelper.isManagedType(getRepository().getConfiguration(), _type) || (val & MetaDataRepository.VALIDATE_UNENHANCED) == 0; // we only do any actions for metadata mode if ((mode & MODE_META) != 0 && (cur & MODE_META) == 0) { resolveMeta(runtime); if (validate && (val & MetaDataRepository.VALIDATE_META) != 0) validateMeta(runtime); } if ((mode & MODE_MAPPING) != 0 && (cur & MODE_MAPPING) == 0) { resolveMapping(runtime); if (validate && (val & MetaDataRepository.VALIDATE_MAPPING) != 0) validateMapping(runtime); } if ((mode & MODE_MAPPING_INIT) != 0 && (cur & MODE_MAPPING_INIT) == 0) initializeMapping(); return false; }
/** * Resolve and validate metadata. Return true if already resolved. */ public boolean resolve(int mode) { if ((_resMode & mode) == mode) return true; int cur = _resMode; _resMode |= mode; int val = _repos.getValidate(); boolean runtime = (val & MetaDataRepository.VALIDATE_RUNTIME) != 0; boolean validate = !ImplHelper.isManagedType(getRepository().getConfiguration(), _type) || (val & MetaDataRepository.VALIDATE_UNENHANCED) == 0; // we only do any actions for metadata mode if ((mode & MODE_META) != 0 && (cur & MODE_META) == 0) { resolveMeta(runtime); if (validate && (val & MetaDataRepository.VALIDATE_META) != 0) validateMeta(runtime); } if ((mode & MODE_MAPPING) != 0 && (cur & MODE_MAPPING) == 0) { resolveMapping(runtime); if (validate && (val & MetaDataRepository.VALIDATE_MAPPING) != 0) validateMapping(runtime); } if ((mode & MODE_MAPPING_INIT) != 0 && (cur & MODE_MAPPING_INIT) == 0) initializeMapping(); return false; }
/** * Resolve and validate metadata. Return true if already resolved. */ public boolean resolve(int mode) { if ((_resMode & mode) == mode) return true; int cur = _resMode; _resMode |= mode; int val = _repos.getValidate(); boolean runtime = (val & _repos.VALIDATE_RUNTIME) != 0; boolean validate = !ImplHelper.isManagedType(getRepository().getConfiguration(), _type) || (val & MetaDataRepository.VALIDATE_UNENHANCED) == 0; // we only do any actions for metadata mode if ((mode & MODE_META) != 0 && (cur & MODE_META) == 0) { resolveMeta(runtime); if (validate && (val & _repos.VALIDATE_META) != 0) validateMeta(runtime); } if ((mode & MODE_MAPPING) != 0 && (cur & MODE_MAPPING) == 0) { resolveMapping(runtime); if (validate && (val & _repos.VALIDATE_MAPPING) != 0) validateMapping(runtime); } if ((mode & MODE_MAPPING_INIT) != 0 && (cur & MODE_MAPPING_INIT) == 0) initializeMapping(); return false; }
boolean runtime = (rep.getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; if (loader == null) loader = rep.getConfiguration().getClassResolverInstance().
boolean runtime = (rep.getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; if (loader == null) loader = rep.getConfiguration().getClassResolverInstance().
/** * Resolve and validate metadata. Return true if already resolved. */ public boolean resolve(int mode) { if ((_resMode & mode) == mode) return true; int cur = _resMode; _resMode |= mode; int val = _repos.getValidate(); boolean runtime = (val & MetaDataRepository.VALIDATE_RUNTIME) != 0; boolean validate = !ImplHelper.isManagedType(getRepository().getConfiguration(), _type) || (val & MetaDataRepository.VALIDATE_UNENHANCED) == 0; // we only do any actions for metadata mode if ((mode & MODE_META) != 0 && (cur & MODE_META) == 0) { resolveMeta(runtime); if (validate && (val & MetaDataRepository.VALIDATE_META) != 0) validateMeta(runtime); } if ((mode & MODE_MAPPING) != 0 && (cur & MODE_MAPPING) == 0) { resolveMapping(runtime); if (validate && (val & MetaDataRepository.VALIDATE_MAPPING) != 0) validateMapping(runtime); } if ((mode & MODE_MAPPING_INIT) != 0 && (cur & MODE_MAPPING_INIT) == 0) initializeMapping(); return false; }
boolean runtime = (rep.getValidate() & MetaDataRepository.VALIDATE_RUNTIME) != 0; if (loader == null) loader = rep.getConfiguration().getClassResolverInstance().
/** * Resolve and validate metadata. Return true if already resolved. */ public boolean resolve(int mode) { if ((_resMode & mode) == mode) return true; int cur = _resMode; _resMode |= mode; int val = _repos.getValidate(); boolean runtime = (val & MetaDataRepository.VALIDATE_RUNTIME) != 0; boolean validate = !ImplHelper.isManagedType(getRepository().getConfiguration(), _type) || (val & MetaDataRepository.VALIDATE_UNENHANCED) == 0; // we only do any actions for metadata mode if ((mode & MODE_META) != 0 && (cur & MODE_META) == 0) { resolveMeta(runtime); if (validate && (val & MetaDataRepository.VALIDATE_META) != 0) validateMeta(runtime); } if ((mode & MODE_MAPPING) != 0 && (cur & MODE_MAPPING) == 0) { resolveMapping(runtime); if (validate && (val & MetaDataRepository.VALIDATE_MAPPING) != 0) validateMapping(runtime); } if ((mode & MODE_MAPPING_INIT) != 0 && (cur & MODE_MAPPING_INIT) == 0) initializeMapping(); return false; }
int validate = repos.getValidate(); if ((validate & MetaDataRepository.VALIDATE_META) != 0 && (!ImplHelper.isManagedType(repos.getConfiguration(),