Package javax.jmi.reflect

Examples of javax.jmi.reflect.RefPackage


    }

    private void removeModel(final String modelUri)
    {
        // remove the model from the repository (if there is one)
        RefPackage model = repository.getExtent(modelUri);
        if (model != null)
        {
            model.refDelete();
        }
    }
View Full Code Here


        {
            logger.debug("loadModel: starting to load model from '" + modelUris[0] + "'");
        }
        long start = System.currentTimeMillis();

        RefPackage model = null;
        if (modelUris != null)
        {
            model = this.createModel(metaModel);
            final XmiReader xmiReader =
                this.getXMIReaderFactory().createXMIReader(
View Full Code Here

        final String[] uris,
        final String[] moduleSearchPaths,
        final MofPackage metaModel)
        throws Exception
    {
        final RefPackage model = this.createModel(metaModel);
        if (modelStreams != null)
        {
            final XmiReader xmiReader =
                this.getXMIReaderFactory().createXMIReader(
                    new MDRXmiReferenceResolver(
View Full Code Here

     * @throws CreationFailedException
     */
    private RefPackage createModel(final MofPackage metaModel)
        throws CreationFailedException
    {
        RefPackage model = this.repository.getExtent(EXTENT_NAME);
        if (model != null)
        {
            this.removeModel(EXTENT_NAME);
        }
        if (logger.isDebugEnabled())
View Full Code Here

     * @return
     */
    protected RefPackage createContainer()
      throws CreationFailedException, Exception
    {
    RefPackage container = null;
    String modelName = generateModelName();
      // Look for a container name which is not already in use.
      // Try each incremented name.
    try {
      container = getRep().getExtent(modelName);
View Full Code Here

   * @throws InvalidNameException
   */
  protected RefClass getRefClassByConceptName(String conceptName)
    throws InvalidNameException
  {
    RefPackage extent = getOutermostRefPackage();
    String[] names = conceptName.split("\\.");
    int i = 0;
    try
    {
      for(i = 0; i<names.length-1; i++)
      {
        extent = (RefPackage)extent.refPackage(names[i]);
      } // end loop
      return extent.refClass(names[i]);
    }
    catch(IndexOutOfBoundsException ex)
    {
      throw new InvalidNameException("Bad concept name '"+conceptName
                                     +"': Can't split name in subnames.");
View Full Code Here

   * @throws InvalidNameException
   */
  protected RefPackage getRefPackageByConceptName(String conceptName)
    throws InvalidNameException
  {
    RefPackage extent = getOutermostRefPackage();
    String[] names = conceptName.split("\\.");
    int i = 0;
    try
    {
      for(i = 0; i<names.length-1; i++)
      {
        extent = (RefPackage)extent.refPackage(names[i]);
      } // end loop
      return extent;
    }
    catch(IndexOutOfBoundsException ex)
    {
View Full Code Here

   * @throws InvalidNameException
   */
  protected RefAssociation getRefAssociationByConceptName(String conceptName)
    throws InvalidNameException
  {
    RefPackage extent = getOutermostRefPackage();
    String[] names = conceptName.split("\\.");
    int i = 0;
    try
    {
      for(i = 0; i<names.length-1; i++)
      {
        extent = (RefPackage)extent.refPackage(names[i]);
      } // end loop
      return extent.refAssociation(names[i]);
    }
    catch(IndexOutOfBoundsException ex)
    {
      throw new InvalidNameException("Bad concept name '"+conceptName
                                     +"': Can't split name in subnames.");
View Full Code Here

    String[] proptype = getEnumType( bean, property);
    if( proptype == null )
      throw new NotFoundException("Not an enumeration.");

    String enumTypeName = (String)proptype[proptype.length-1];
    RefPackage pack = getRefPackageByType( proptype );
    RefEnum enumValue = null;
    // next one throw InvalidNameException
    enumValue = pack.refGetEnum(enumTypeName, value);

    RefObject obj = (RefObject)bean;
    obj.refSetValue( property, enumValue);
  }
View Full Code Here

   * @param proptype List
   * @return RefPackage
   */
  protected RefPackage getRefPackageByType(String[] names)
  {
    RefPackage extent = getOutermostRefPackage();
    int i=0;
    try
    {
      for(i = 0; i<names.length-1; i++)
      {
        extent = (RefPackage)extent.refPackage(names[i]);
      }
    }
    catch(InvalidNameException ex)
    {
      if(i>0)
View Full Code Here

TOP

Related Classes of javax.jmi.reflect.RefPackage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.