@Override public Boolean getBooleanProperty(final String propertyName) { return _properties.getBoolean(propertyName); }
@Override public Boolean getLoadPackageMapping() { return _properties.getBoolean(XMLProperties.LOAD_PACKAGE_MAPPING); }
@Override public Boolean getUseIntrospector() { return _properties.getBoolean(XMLProperties.USE_INTROSPECTION); }
@Override public boolean getLenientIdValidation() { Boolean lenientIdValidation = _properties.getBoolean(XMLProperties.LENIENT_ID_VALIDATION); if (lenientIdValidation == null) { String message = "Property lenientIdValidation must not be null"; LOG.warn(message); throw new IllegalStateException(message); } return lenientIdValidation.booleanValue(); }
@Override public boolean getLenientSequenceOrder() { Boolean lenientSequenceOrder = _properties.getBoolean(XMLProperties.LENIENT_SEQUENCE_ORDER); if (lenientSequenceOrder == null) { String message = "Property lenientSequenceOrder must not be null"; LOG.warn(message); throw new IllegalStateException(message); } return lenientSequenceOrder.booleanValue(); }
@Override public boolean marshallingValidation() { Boolean marshallingValidation = _properties.getBoolean(XMLProperties.MARSHALLING_VALIDATION); if (marshallingValidation == null) { String message = "Property marshallingValidation must not be null"; LOG.warn(message); throw new IllegalStateException(message); } return marshallingValidation.booleanValue(); }
@Override public boolean strictElements() { Boolean strictElements = _properties.getBoolean(XMLProperties.STRICT_ELEMENTS); if (strictElements == null) { String message = "Property strictElements must not be null"; LOG.warn(message); throw new IllegalStateException(message); } return strictElements.booleanValue(); }
/** * Construct an instance of TransactionManagerRegistry that uses given * LocalConfiguration to get required configuration properties. * * @param properties The properties. */ public TransactionManagerRegistry(final AbstractProperties properties) { _registry = new TransactionManagerFactoryRegistry(properties); _initializationAtRegistration = properties.getBoolean( CPAProperties.TRANSACTION_MANAGER_INIT, false); }
/** * Constructor. * * @param params Parameters for key generator. */ public AbstractAfterKeyGenerator(final Properties params) { AbstractProperties properties = CPAProperties.getInstance(); _useJDBC30 = properties.getBoolean(CPAProperties.USE_JDBC30, false); if (params != null) { _triggerPresent = "true".equals(params.getProperty("trigger", "false")); _seqName = params.getProperty("sequence", "{0}_seq"); } }
@Override public XMLReader getXMLReader(final String features) { XMLReader reader = null; Boolean validation = _properties.getBoolean(XMLProperties.PARSER_VALIDATION); Boolean namespaces = _properties.getBoolean(XMLProperties.NAMESPACES); String readerClassName = _properties.getString(XMLProperties.PARSER); if (readerClassName == null || readerClassName.length() == 0) { SAXParser saxParser = XMLParserUtils.getSAXParser(validation.booleanValue(), namespaces.booleanValue()); if (saxParser != null) { try { reader = saxParser.getXMLReader(); } catch (SAXException e) { LOG.error(Messages.format("conf.configurationError", e)); } } } if (reader == null) { if ((readerClassName == null) || (readerClassName.length() == 0) || (readerClassName.equalsIgnoreCase("xerces"))) { readerClassName = "org.apache.xerces.parsers.SAXParser"; } reader = XMLParserUtils.instantiateXMLReader(readerClassName); } XMLParserUtils.setFeaturesOnXmlReader( _properties.getString(XMLProperties.PARSER_FEATURES, features), _properties.getString(XMLProperties.PARSER_FEATURES_DISABLED, ""), validation.booleanValue(), namespaces.booleanValue(), reader); return reader; }
/** * @inheritDoc */ public QueryExpression getQueryExpression() { AbstractProperties properties = CPAProperties.getInstance(); boolean useNewSyntaxForSQLServer = properties.getBoolean( CPAProperties.MSSQL_ANSI_COMPLIANT, false); if (useNewSyntaxForSQLServer) { return new JDBCQueryExpression(this); } return new SQLServerQueryExpression(this); }
public static Parser getParser(final AbstractProperties properties, final String features) { Parser parser = null; Boolean validation = properties.getBoolean(XMLProperties.PARSER_VALIDATION); Boolean namespaces = properties.getBoolean(XMLProperties.NAMESPACES); String parserClassName = properties.getString(XMLProperties.PARSER); if ((parserClassName == null) || (parserClassName.length() == 0)) {
/** * Instantiates a DataSourceConnectionFactory with given name, engine, datasource * and mapping. * * @param name The Name of the database configuration. * @param engine The Name of the persistence factory to use. * @param datasource The preconfigured datasource to use for creating connections. * @param mapping The previously loaded mapping. * @param txManager The transaction manager to use. * @throws MappingException If LockEngine could not be initialized. */ public static synchronized void loadDatabase( final String name, final String engine, final DataSource datasource, final Mapping mapping, final TransactionManager txManager) throws MappingException { boolean useProxies = CPAProperties.getInstance().getBoolean( CPAProperties.USE_JDBC_PROXIES, true); ConnectionFactory cf = new DataSourceConnectionFactory(datasource, useProxies); DatabaseContext context = new DatabaseContext(name, engine, mapping, txManager, cf); if (CONTEXTS.put(name, context) != null) { LOG.warn(Messages.format("jdo.configLoadedTwice", name)); } }
boolean init = properties.getBoolean(CPAProperties.INITIALIZE_AT_LOAD, true);
/** * @see org.castor.xml.InternalContext#getOutputFormat() */ public static OutputFormat getOutputFormat(final AbstractProperties properties) { boolean indent = properties.getBoolean(XMLProperties.USE_INDENTATION, false); String version = properties.getString(XMLProperties.XML_VERSION, "1.0"); OutputFormat format = getSerializerFactory(properties.getString(XMLProperties.SERIALIZER_FACTORY)) .getOutputFormat(); format.setMethod(OutputFormat.XML); format.setVersion(version); format.setIndenting(indent); // There is a bad interaction between the indentation and the // setPreserveSpace option. The indentated output is strangely indented. if (!indent) { format.setPreserveSpace(true); } return format; } // -- getOutputFormat
final JdoConf jdoConf, final int index, final Mapping mapping) throws MappingException { boolean useProxies = CPAProperties.getInstance().getBoolean( CPAProperties.USE_JDBC_PROXIES, true);