3 The file is used to define opening platform type
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 package org
.tianocore
.frameworkwizard
.common
.Identifications
;
17 import java
.io
.IOException
;
19 import org
.apache
.xmlbeans
.XmlException
;
20 import org
.tianocore
.PlatformSurfaceAreaDocument
;
21 import org
.tianocore
.frameworkwizard
.common
.Log
;
22 import org
.tianocore
.frameworkwizard
.common
.OpenFile
;
23 import org
.tianocore
.frameworkwizard
.platform
.PlatformIdentification
;
25 public class OpeningPlatformType
extends OpeningFileType
{
27 // Define class members
29 private PlatformSurfaceAreaDocument
.PlatformSurfaceArea xmlFpd
= null;
31 private PlatformIdentification id
= null;
33 public OpeningPlatformType() {
37 public OpeningPlatformType(PlatformIdentification identification
, PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
38 this.id
= identification
;
42 public PlatformSurfaceAreaDocument
.PlatformSurfaceArea
getXmlFpd() {
46 public void setXmlFpd(PlatformSurfaceAreaDocument
.PlatformSurfaceArea xmlFpd
) {
50 public PlatformIdentification
getId() {
54 public void setId(PlatformIdentification id
) {
58 public void reload() {
59 if (this.id
!= null) {
60 String path
= id
.getPath();
61 if (path
.length() > 0) {
63 this.xmlFpd
= OpenFile
.openFpdFile(id
.getPath());
64 } catch (IOException e
) {
65 Log
.err("Open Platform Surface Area " + path
, e
.getMessage());
66 } catch (XmlException e
) {
67 Log
.err("Open Platform Surface Area " + path
, e
.getMessage());
68 } catch (Exception e
) {
69 Log
.err("Open Platform Surface Area " + path
, "Invalid file type");