Class JDOMetaDataProperties


  • public final class JDOMetaDataProperties
    extends Object
    This class parses properties containing meta data information about classes. The syntax of the properties is the following:
    • the keys in the properties file are fully qualified classnames or fully qualified fieldnames
    • a fields is separated by a classname with a hash mark ('#') (e.g. "test.Test#test1")
    • all classnames are given in a natural form (e.g. "java.lang.Integer", "java.lang.Integer[][]", "int", "test.Test$Test1")
    • property keys are classnames and fieldnames (e.g. "test.Test=...", "test.Test#field1=...")
    • Classnames can have the following attributes:
      • jdo:{persistent|transactional}
      • super: <classname>
      • access: {public|protected|package|private}
    • Fieldnames can have the following attributes:
      • type:<type>
      • access: {public|protected|package|private}
      • jdo:{persistent|transactional|transient}
      • annotation:{pk|dfg|mediated}
    • the names of the attributes can be ommitted: you can say
      test.Test1#field1=jdo:persistent,type:java.lang.String,pk,...
      or
      test.Test1#field1=persistent,java.lang.String,pk,...
      or
      test.Test1#field1=jdo:persistent,java.lang.String,pk,...
    • in order to find fields of a class, a line for the class has to be specified in the properties: To find the field test.Test1#field, the keys test.Test1 and test.Test1#Field have to be present.
    This class is not thread safe.
    • Constructor Detail

      • JDOMetaDataProperties

        public JDOMetaDataProperties​(Properties props)
        Creates a new object with the given properties.
        Parameters:
        props - The properties.
        See Also:
        properties
    • Method Detail

      • getJDOClass

        public final com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataProperties.JDOClass getJDOClass​(String classname)
                                                                                                   throws JDOMetaDataUserException
        Get the information about the class with the given name.
        Parameters:
        classname - The classname.
        Returns:
        The information about the class or null if no information is given.
        Throws:
        JDOMetaDataUserException - If something went wrong parsing the properties.
      • getJDOField

        public final com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataProperties.JDOField getJDOField​(String fieldname,
                                                                                                          String classname)
                                                                                                   throws JDOMetaDataUserException
        Gets the information about the specified field.
        Parameters:
        classname - The name of the class.
        fieldname - The name of the field of the class.
        Returns:
        The information about the field or null if no information could be found.
        Throws:
        JDOMetaDataUserException - If something went wrong parsing the properties.
      • getKnownClassNames

        public final String[] getKnownClassNames()
        Gets all classnames in the properties.
        Returns:
        All classnames in the properties.