Codota Logo
AbstractProperties
Code IndexAdd Codota to your IDE (free)

How to use
AbstractProperties
in
org.castor.core.util

Best Java code snippets using org.castor.core.util.AbstractProperties (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: org.codehaus.castor/castor-jdo

/**
 * Construct an instance of CacheFactoryRegistry that uses given properties
 * to get required configuration properties.
 * 
 * @param properties The properties.
 */
public CacheFactoryRegistry(final AbstractProperties properties) {
  Object[] objects = properties.getObjectArray(
      CPAProperties.CACHE_FACTORIES, properties.getApplicationClassLoader());
  for (int i = 0; i < objects.length; i++) {
    CacheFactory factory = (CacheFactory) objects[i];
    _cacheFactories.put(factory.getCacheType(), factory);
  }
}
origin: org.codehaus.castor/castor-xml

@Override
public Boolean getBooleanProperty(final String propertyName) {
 return _properties.getBoolean(propertyName);
}
origin: org.codehaus.castor/castor-xml

@Override
public String getStringProperty(final String propertyName) {
 return _properties.getString(propertyName);
}
origin: org.codehaus.castor/castor-core

/**
 * Construct properties with given parent. Application and domain class loaders will be
 * initialized to the ones of the parent.
 * 
 * @param parent Parent properties.
 */
protected AbstractProperties(final AbstractProperties parent) {
 _applicationClassLoader = parent.getApplicationClassLoader();
 _domainClassLoader = parent.getDomainClassLoader();
 _parent = parent;
}
origin: org.codehaus.castor/castor-xml

private void setPropertyInternal(final String propertyName, final Object value) {
 Object oldValue = this._properties.getObject(propertyName);
 if (oldValue == null) {
  if (value != null) {
   this._properties.put(propertyName, value);
   this.propertyChangeSupport.firePropertyChange(propertyName, oldValue, value);
  }
 } else {
  if (!oldValue.equals(value)) {
   this._properties.put(propertyName, value);
   this.propertyChangeSupport.firePropertyChange(propertyName, oldValue, value);
  }
 }
}
origin: org.codehaus.castor/castor-xml

@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;
}
origin: org.codehaus.castor/castor-core

boolean userPropertiesLoaded = loadFromClassPath(properties, "/" + filename);
 userPropertiesLoaded = loadFromWorkingDirectory(properties, filename);
  if (file.exists()) {
   LOG.info("Loading custom Castor properties from " + file.getAbsolutePath());
   userPropertiesLoaded = loadFromFile(properties, file);
  } else {
   LOG.warn(file.getAbsolutePath() + " is not a valid file.");
origin: org.codehaus.castor/castor-core

/**
 * Searches for the property with the specified key in this property map. If the key is not found
 * in this property map, the parent property map, and its parents, recursively, are then checked.
 * <br/>
 * If the key maps to any object value, it will be returned as is. If the property is not found,
 * <code>null</code> will be returned.
 *
 * @param key Property key.
 * @return Object in this property map with the specified key value.
 */
public final Object getObject(final String key) {
 return get(key);
}
origin: org.codehaus.castor/castor-xml

/**
 * Creates an instance of this registry, loading the mapping loader factories from the
 * castor.properties file.
 * 
 * @param properties Properties.
 */
public MappingLoaderRegistry(final AbstractProperties properties) {
 Object[] objects = properties.getObjectArray(CoreProperties.MAPPING_LOADER_FACTORIES,
   getClass().getClassLoader());
 for (Object mappingLoaderFactory : objects) {
  _mappingLoaderFactories.add((MappingLoaderFactory) mappingLoaderFactory);
 }
}
origin: org.codehaus.castor/castor-core

/**
 * Load module properties from default locations. <br/>
 * First it loads default properties contained in Castor JAR. This gets overwritten by a
 * properties found on Java library directory. If no properties could be found until that point a
 * PropertiesException will be thrown.
 * 
 * @param path Path to the default properties to load.
 * @param filename Name of the properties file.
 */
protected void loadDefaultProperties(final String path, final String filename) {
 Properties properties = new Properties();
 // Get default properties from the Castor JAR.
 boolean inCastorJar = loadFromClassPath(properties, path + filename);
 // Get overriding properties from the Java library directory, ignore if not
 // found. If found merge existing properties.
 boolean inJavaLibDir = loadFromJavaHome(properties, filename);
 // Couldn't find properties in Castor jar nor Java library directory.
 if (!inCastorJar && !inJavaLibDir) {
  throw new PropertiesException("Failed to load properties: " + filename);
 }
 _map.putAll(properties);
}
origin: org.codehaus.castor/castor-core

/**
 * Load properties with given filename from local working directory and merge them into the given
 * properties.
 * 
 * @param properties Properties to merge the loaded ones into.
 * @param filename Name of the properties file to load from local working directory.
 * @return <code>true</code> if properties could be loaded, <code>false</code> otherwise.
 */
private boolean loadFromWorkingDirectory(final Properties properties, final String filename) {
 return loadFromFile(properties, new File(filename));
}
origin: org.codehaus.castor/castor-xml

@Override
public Object getProperty(final String propertyName) {
 return _properties.getObject(propertyName);
}
origin: org.codehaus.castor/castor-jdo

/**
 * {@inheritDoc}
 */
public final void configure(final AbstractProperties properties) {
  _lobBufferSize = properties.getInteger(
      CPAProperties.LOB_BUFFER_SIZE, DEFAULT_LOB_BUFFER_SIZE);
  if (LOG.isDebugEnabled()) { LOG.debug("Using lobBufferSize: " + _lobBufferSize); }
}
 
origin: org.codehaus.castor/castor-xml

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)) {
  SAXParser saxParser =
   XMLReader xmlReader = (XMLReader) parser;
   XMLParserUtils.setFeaturesOnXmlReader(
     properties.getString(XMLProperties.PARSER_FEATURES, features),
     properties.getString(XMLProperties.PARSER_FEATURES_DISABLED, ""),
     validation.booleanValue(), namespaces.booleanValue(), xmlReader);
origin: org.codehaus.castor/castor-core

/**
 * Searches for the property with the specified key in this property map. If the key is not found
 * in this property map, the parent property map, and its parents, recursively, are then checked.
 * <br/>
 * If the key maps to any object value, it will be returned as is. If the property is not found,
 * <code>null</code> will be returned.
 *
 * @param key Key of the property to get from properties.
 * @return Object in this property map with the specified key value.
 */
protected synchronized Object get(final String key) {
 Object value = _map.get(key);
 if ((value == null) && (_parent != null)) {
  value = _parent.get(key);
 }
 return value;
}
origin: org.codehaus.castor/castor-core

/**
 * Load properties with given filename from Java library directory and merge them into the given
 * properties.
 * 
 * @param properties Properties to merge the loaded ones into.
 * @param filename Name of the properties file to load from Java library directory.
 * @return <code>true</code> if properties could be loaded, <code>false</code> otherwise.
 */
private boolean loadFromJavaHome(final Properties properties, final String filename) {
 try {
  String javaHome = System.getProperty("java.home");
  if (javaHome == null) {
   return false;
  }
  return loadFromFile(properties, new File(new File(javaHome, "lib"), filename));
 } catch (SecurityException ex) {
  LOG.warn("Security policy prevented access to system property 'java.home'.", ex);
  return false;
 }
}
origin: org.codehaus.castor/castor-jdo

/**
 * Create a new registry instance of key generator factories. The registry will be initialized
 * with all key generator factories specified through <b>KEYGENERATOR_FACTORIES</b> property
 * of given properties.
 * 
 * @param properties The properties to use.
 */
public KeyGeneratorFactoryRegistry(final AbstractProperties properties) {
  Object[] objects = properties.getObjectArray(
      CPAProperties.KEYGENERATOR_FACTORIES, properties.getApplicationClassLoader());
  for (int i = 0; i < objects.length; i++) {
    KeyGeneratorFactory factory = (KeyGeneratorFactory) objects[i];
    _factories.put(factory.getKeyGeneratorName(), factory);
  }
}
origin: org.codehaus.castor/castor-xml

@Override
public Boolean getLoadPackageMapping() {
 return _properties.getBoolean(XMLProperties.LOAD_PACKAGE_MAPPING);
}
origin: org.codehaus.castor/castor-xml

/**
 * @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
origin: org.codehaus.castor/castor-xml

@Override
public NodeType getPrimitiveNodeType() {
 if (_primitiveNodeType != null) {
  return _primitiveNodeType;
 }
 String prop = _properties.getString(XMLProperties.PRIMITIVE_NODE_TYPE, null);
 if (prop == null) {
  return null;
 }
 _primitiveNodeType = NodeType.getNodeType(prop);
 return _primitiveNodeType;
}
org.castor.core.utilAbstractProperties

Javadoc

Abstract base class to hold Castor configuration properties.

Most used methods

  • getApplicationClassLoader
    Get classloader to be used for all classes of Castor and its required libraries.
  • getBoolean
    Searches for the property with the specified key in this property map. If the key is not found in th
  • getObjectArray
    Searches for the property with the specified key in this property map. If the key is not found in th
  • getString
    Searches for the property with the specified key in this property map. If the key is not found in th
  • get
    Searches for the property with the specified key in this property map. If the key is not found in th
  • getDomainClassLoader
    Get classloader to be used for all domain objects that are marshalled/unmarshalled or loaded from th
  • getInteger
    Searches for the property with the specified key in this property map. If the key is not found in th
  • getObject
    Searches for the property with the specified key in this property map. If the key is not found in th
  • loadFromClassPath
    Load properties with given filename from classpath and merge them into the given properties.
  • loadFromFile
    Load properties with given file and merge them into the given properties.
  • loadFromJavaHome
    Load properties with given filename from Java library directory and merge them into the given proper
  • loadFromWorkingDirectory
    Load properties with given filename from local working directory and merge them into the given prope
  • loadFromJavaHome,
  • loadFromWorkingDirectory,
  • put

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ImageIO (javax.imageio)
  • JPanel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now